geos_intersection {geos}R Documentation

Binary geometry operators

Description

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 ⁠_prec()⁠ variants, the grid size such that all vertices of the resulting geometry will lie on the grid.

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)")


[Package geos version 0.2.4 Index]