implement geometry type filters
Allow filtering OSM features based on their geometry's type: point, line, polygon or other.
Possible syntax: geometry:…
In general, for this the filter need to be executed twice: once to check against the OSM entity and once more to check against the built (JTS) geometry. For this a method to apply the filter expression to a JTS geometry of an OSM entity is needed, e.g. public boolean applyGeometry(OSMEntity entity, Geometry geom);
. Here's how the individual geometry types would be implemented:
-
geom:point
→type:node
-
geom:line
→type:way
plus a secondary geometry check (geom instanceOf Lineal
) -
geom:polygon
→(type:way and <number of nodes greater than 3> and <way forms closed loop>) or (type:relation and type=multipolygon)
plus a secondary geometry check (geom instanceOf Polygonal
) -
geom:other
→type:relation
plus a secondary geometry check (!(geom instanceOf Puntal or geom instanceOf Lineal or geom instanceOf Polygonal)
)
This is relevant for https://gitlab.gistools.geog.uni-heidelberg.de/giscience/big-data/ohsome/ohsome-api/merge_requests/34, but not necessary for it (it can also be added at a later point).