geos_intersection: Binary geometry operators

Description Usage Arguments Value Examples

View source: R/geos-binary-geometry.R

Description

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
geos_intersection(geom1, geom2)

geos_difference(geom1, geom2)

geos_sym_difference(geom1, geom2)

geos_union(geom1, geom2)

geos_shared_paths(geom1, geom2)

geos_snap(geom1, geom2, tolerance = .Machine$double.eps^2)

geos_clearance_line_between(geom1, geom2)

Arguments

geom1

GEOS geometry vectors, recycled to a common length.

geom2

GEOS geometry vectors, recycled to a common length.

tolerance

The maximum separation of vertices that should be considered equal.

Value

A GEOS geometry vector along the recycled length of geom1 and geom2.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)")

geos documentation built on Jan. 13, 2021, 8:13 a.m.