inside {rcgal}R Documentation

Finds shapes that contain given points

Description

inside returns indices of shapes that contain given points

Usage

inside(shp, x, y)

Arguments

shp

shape object (as returned by read.shp(..., format="polygon")) to match against

x

x coordinates of the points to match

y

y coordinates of the points to match

Details

The matching uses bounding box as a first approximation and then CGAL point/polygon test to determine if a point is inside a shape, returninig the first shape that matches or NA otherwise. Holes are supported as well as multi-part polygons.

Value

If all=FALSE: Integer vector of the same length as the number of points, each value is either an index of the first matching shape or NA if the point is not inside of any shapes.

If all=TRUE: List of integer vectors with the indices of matching shapes (which whill be empty if there is no match). There will be as many elements in the list as there are points.

Author(s)

Simon Urbanek


[Package rcgal version 0.1-2 Index]