Class DataExtractionTransformer
java.lang.Object
org.heigit.ohsome.ohsomeapi.executor.DataExtractionTransformer
- All Implemented Interfaces:
Serializable
Used by data extraction requests to create GeoJSON features from OSM entities.
- See Also:
-
Constructor Summary
ConstructorDescriptionDataExtractionTransformer
(String startTimestamp, String endTimestamp, org.heigit.ohsome.oshdb.filter.FilterExpression filter, boolean isContributionsEndpoint, boolean isContributionsLatestEndpoint, boolean clipGeometries, boolean includeTags, boolean includeOSMMetadata, boolean includeContributionTypes, InputProcessingUtils inputUtils, ExecutionUtils exeUtils, Set<Integer> keysInt, ElementsGeometry outputGeometry, Set<SimpleFeatureType> simpleFeatureTypes, boolean isContainingSimpleFeatureTypes) Creates a new data extraction transformer, adhering to the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionList<org.wololo.geojson.Feature>
buildChangedFeatures
(List<org.heigit.ohsome.oshdb.util.mappable.OSMContribution> contributions) Returns a list of GeoJSON features representing the given OSM contributions.List<org.wololo.geojson.Feature>
buildUnchangedFeatures
(org.heigit.ohsome.oshdb.util.mappable.OSMEntitySnapshot snapshot) Returns either a singleton of the given OSM entity (snapshot), or an empty list, if it doesn't match the given (simple feature type) filter.
-
Constructor Details
-
DataExtractionTransformer
public DataExtractionTransformer(String startTimestamp, String endTimestamp, org.heigit.ohsome.oshdb.filter.FilterExpression filter, boolean isContributionsEndpoint, boolean isContributionsLatestEndpoint, boolean clipGeometries, boolean includeTags, boolean includeOSMMetadata, boolean includeContributionTypes, InputProcessingUtils inputUtils, ExecutionUtils exeUtils, Set<Integer> keysInt, ElementsGeometry outputGeometry, Set<SimpleFeatureType> simpleFeatureTypes, boolean isContainingSimpleFeatureTypes) Creates a new data extraction transformer, adhering to the given parameters.- Parameters:
startTimestamp
- start timestamp of the queryendTimestamp
- end timestamp of the queryfilter
- the filter of the queryisContributionsEndpoint
- set true if the requested resource is a `/contributions` endpointisContributionsLatestEndpoint
- set true if the requested resource is a `/contributions/latest` endpointclipGeometries
- whether or not the output geometries should be clipped to the query area-of-interest or notincludeTags
- set true if the result should include all OSM entity's tags as GeoJSON feature propertiesincludeOSMMetadata
- set true if the result should include the OSM entity metadata (e.g. changeset id, timestamp, version number)includeContributionTypes
- set true if the result should include the contribution type for `/elements/contributions` resourcesinputUtils
- input processing utility objectexeUtils
- the execution utils objectkeysInt
- (for the deprecated `keys` filter parameter) set the list of always to be returned OSM tags in the GeoJSON's features' propertiesoutputGeometry
- specifies what should be returned as the GeoJSON feature's geometry: either the full geometry, its bbox or its centroid.simpleFeatureTypes
- if the query uses the (deprecated) types parameter, and it contains simple feature "geometry" types, specify the set of to be returned geometry types hereisContainingSimpleFeatureTypes
- set true if the query uses the (deprecated) types
-
-
Method Details
-
buildChangedFeatures
public List<org.wololo.geojson.Feature> buildChangedFeatures(List<org.heigit.ohsome.oshdb.util.mappable.OSMContribution> contributions) Returns a list of GeoJSON features representing the given OSM contributions.The output is slightly different between the `/contributions` endpoint and the full history data extraction, but always one GeoJSON feature for each modification of an OSM entity is returned. Contribution endpoints optionally return the contribution type annotated in the resulting GeoJSON properties, while full history endpoints include validFrom-validTo dates.
- Parameters:
contributions
- list of modifications of a single OSMEntity.- Returns:
- list of GeoJSON features corresponding to the given OSM entity's modifications.
-
buildUnchangedFeatures
public List<org.wololo.geojson.Feature> buildUnchangedFeatures(org.heigit.ohsome.oshdb.util.mappable.OSMEntitySnapshot snapshot) Returns either a singleton of the given OSM entity (snapshot), or an empty list, if it doesn't match the given (simple feature type) filter.This is only used by full history data extraction requests, to also include entities in the result which don't change at all during the given start and end times.
- Parameters:
snapshot
- OSM entity to return.- Returns:
- Either a singleton of a GeoJSON feature representing this OSM entity, or an empty collection if it doesn't fit the given (simple feature types) filter.
-