Description Usage Arguments Details Value See Also Examples
Takes a data-Point and a data-Polygon or data-MultiPolygon and determines if the point resides inside the polygon
1 | lawn_inside(point, polygon, lint = FALSE)
|
point |
Input point. |
polygon |
Input polygon or multipolygon. |
lint |
(logical) Lint or not. Uses geojsonhint. Takes up increasing
time as the object to get linted increases in size, so probably use by
default for small objects, but not for large if you know they are good
geojson objects. Default: |
The polygon can be convex or concave. The function accounts for holes.
TRUE
if the Point IS inside the Polygon, FALSE
if
the Point IS NOT inside the Polygon.
Other joins:
lawn_tag()
,
lawn_within()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | point1 <- '{
"type": "Feature",
"properties": {
"marker-color": "#f00"
},
"geometry": {
"type": "Point",
"coordinates": [-111.467285, 40.75766]
}
}'
point2 <- '{
"type": "Feature",
"properties": {
"marker-color": "#0f0"
},
"geometry": {
"type": "Point",
"coordinates": [-111.873779, 40.647303]
}
}'
poly <- '{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [[
[-112.074279, 40.52215],
[-112.074279, 40.853293],
[-111.610107, 40.853293],
[-111.610107, 40.52215],
[-112.074279, 40.52215]
]]
}
}'
lawn_inside(point1, poly)
lawn_inside(point2, poly)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.