Description Usage Arguments Value Examples
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.
1 | qgis_countpointsinpolygon(polygon, points, field = "Count", output)
|
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 |
simple feature, geojson, or shapefile
1 2 3 4 | qgis_countpointsinpolygon(polygon = Census_Tracts,
points = Gunshots,
field = 'Count',
output = 'C://Documents/Spatial/shots_per_tract.shp')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.