This function reads an OpenStreetMap file, selects the multipolygons with a non-null building attribute, calculates the centroids of the selected buildings, and writes the resulting centroids to a GeoJSON file.

make_origins(
  osm_file = "input/input.osm.pbf",
  query = "SELECT osm_id FROM multipolygons WHERE building IS NOT NULL",
  output_file = "input/buildings.geojson"
)

Arguments

osm_file

The file path or name of the OSM file in PBF format. Default is "input/input.osm.pbf".

query

The SQL query to select the multipolygons with a non-null building attribute. Default is "SELECT osm_id FROM multipolygons WHERE building IS NOT NULL".

output_file

The file path or name of the output GeoJSON file containing the centroids of the selected buildings. Default is "input/buildings.geojson".

Value

None