geos_intersection {geos} | R Documentation |
Binary geometry operators
Description
-
geos_intersection()
returns the set of points common to bothx
andy
. -
geos_difference()
returns the set of points fromx
that are not contained byy
. -
geos_sym_difference()
returns the set of points that are not common tox
andy
. -
geos_union()
returns the set of points contained by eitherx
ory
. -
geos_shared_paths()
returns a GEOMETRYCOLLECTION containing two MULTILINESTRINGS: the first containing paths in the same direction, the second containing common paths in the opposite direction. -
geos_snap()
snaps the vertices ofx
withintolerance
ofy
toy
.
Usage
geos_intersection(geom1, geom2)
geos_difference(geom1, geom2)
geos_sym_difference(geom1, geom2)
geos_union(geom1, geom2)
geos_intersection_prec(geom1, geom2, grid_size)
geos_difference_prec(geom1, geom2, grid_size)
geos_sym_difference_prec(geom1, geom2, grid_size)
geos_union_prec(geom1, geom2, grid_size)
geos_shared_paths(geom1, geom2)
geos_snap(geom1, geom2, tolerance = .Machine$double.eps^2)
geos_clearance_line_between(geom1, geom2, prepare = FALSE)
Arguments
geom1 , geom2 |
GEOS geometry vectors, recycled to a common length. |
grid_size |
For |
tolerance |
The maximum separation of vertices that should be considered equal. |
prepare |
Use prepared geometries to calculate clearance line |
Value
A GEOS geometry vector along the recycled
length of geom1
and geom2
.
Examples
poly1 <- "POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))"
poly2 <- "POLYGON ((5 5, 5 15, 15 15, 15 5, 5 5))"
geos_intersection(poly1, poly2)
geos_difference(poly1, poly2)
geos_sym_difference(poly1, poly2)
geos_union(poly1, poly2)
line <- "LINESTRING (11 0, 11 10)"
geos_snap(poly1, line, tolerance = 2)
geos_shared_paths("LINESTRING (0 0, 1 1, 2 2)", "LINESTRING (3 3, 2 2, 1 1)")