ohsome_extract_contributions {ohsome}R Documentation

Extract OSM contributions

Description

Creates an ohsome_query object for OSM contribution extraction

Usage

ohsome_extract_contributions(
  boundary = NULL,
  geometryType = c("centroid", "bbox", "geometry"),
  latest = FALSE,
  time = NULL,
  properties = NULL,
  clipGeometry = TRUE,
  ...
)

ohsome_contributions_bbox(boundary = NULL, ...)

ohsome_contributions_centroid(boundary = NULL, ...)

ohsome_contributions_geometry(boundary = NULL, ...)

Arguments

boundary

Bounding geometries specified by WGS84 coordinates in the order ⁠lon,lat⁠. The geometries of sf are transformed to WGS84 if the CRS of the object is known. The following classes are supported:

  • sf with (MULTI)POLYGON geometries

  • sfc with (MULTI)POLYGON geometries

  • sfg with (MULTI)POLYGON geometries and WGS 84 coordinates

  • bbox created with sf::st_bbox() or tmaptools::bb()

  • matrix created with sp::bbox() or osmdata::getbb()

  • character providing textual definitions of bounding polygons, boxes or circles as allowed by the ohsome API (see ohsome API - Boundaries ):

    • bboxes: WGS84 coordinates in the following format: "id1:lon1,lat1,lon2,lat2|id2:lon1,lat1,lon2,lat2|..." OR "lon1,lat1,lon2,lat2|lon1,lat1,lon2,lat2|..."

    • bcircles: WGS84 coordinates + radius in meter in the following format: "id1:lon,lat,r|id2:lon,lat,r|..." OR "lon,lat,r|lon,lat,r|..."

    • bpolys: WGS84 coordinates given as a list of coordinate pairs (as for bboxes) or GeoJSON FeatureCollection. The first point has to be the same as the last point and MultiPolygons are only supported in GeoJSON.

  • list of bbox, matrix or character. Bounding geometry types of all list elements must be the same. Does not work with GeoJSON FeatureCollections.

geometryType

character; type of geometry to be extracted:

  • "centroid",

  • "bboxes" (bounding boxes), or

  • "geometry"

Caveat: Node elements are omitted from results in queries for bounding boxes.

latest

logical; if TRUE, request only the latest contributions provided to each OSM element.

time

character; time parameter of the query (see Supported time formats).

properties

character; properties to be extracted with the contributions:

  • "tags", and/or

  • "metadata" (i.e. ⁠@changesetId⁠, ⁠@lastEdit⁠, ⁠@osmType⁠, ⁠@version⁠), and/or

  • "contributionTypes" (i.e. ⁠@creation⁠, ⁠@tagChange⁠, ⁠@deletion⁠, and ⁠@geometryChange⁠)

Multiple values can be provided as comma-separated character or as character vector. This defaults to NULL (provides ⁠@contributionChangesetId⁠, ⁠@osmId⁠ and ⁠@timestamp⁠).

clipGeometry

logical; specifies whether the returned geometries should be clipped to the query’s spatial boundary

...

Parameters of the request to the ohsome API endpoint.

Details

ohsome_extract_contributions() creates an ohsome_query object for OSM contribution extraction. ohsome_contributions_bbox(), ohsome_contributions_centroid() and ohsome_contributions_geometry() are wrapper functions for specific contributions extraction endpoints. Boundary objects are passed via set_boundary() into ohsome_boundary().

Value

An ohsome_query object. The object can be sent to the ohsome API with ohsome_post(). It consists of the following elements:

See Also

ohsome API Endpoints – Contributions Extraction

Examples

# Extract contributions to man-made objects around "Null Island" with metadata:
ohsome_contributions_geometry(
    "0,0,10", 
    filter = "man_made=*", 
    time = c("2021-01-01", "2022-01-01"),
    properties = "metadata"
)


[Package ohsome version 0.2.2 Index]