qgis_countpointsinpolygon: Count point in polygons

Description Usage Arguments Value Examples

Description

This algorithm takes a points layer and a polygon layer and counts the number of points from the first one in each polygons of the second one.

A new polygons layer is generated, with the exact same content as the input polygons layer, but containing an additional field with the points count corresponding to each polygon.

Usage

1
qgis_countpointsinpolygon(polygon, points, field = "Count", output)

Arguments

polygon

<chr> or simple feature object Target layer. Use either a file destination or simple feature dataframe

points

<chr> or simple feature object Point layer you are counting. Use either a string file destination or simple feature dataframe

field

<chr> Name of new atrribute column

output

<chr> file destination. .geojson or .shp

Value

simple feature, geojson, or shapefile

Examples

1
2
3
4
qgis_countpointsinpolygon(polygon = Census_Tracts,
                          points = Gunshots,
                          field = 'Count',
                          output = 'C://Documents/Spatial/shots_per_tract.shp')

smitty1788/mercatoR documentation built on May 14, 2019, 3:03 p.m.