Closed Joxit closed 6 months ago
Imposm inserts the geometry as 978521649 and not -13155725. Imposm always inserts a geometry only once for the same mapped tags (building=any in this case). The outer way should not have a building=yes tag if the metadata is on the relation: https://wiki.openstreetmap.org/wiki/Relation:multipolygon
Hello, thank you for your fast response, unfortunately, when I remove the tag building=yes
on 978521649
, the behavior is still the same and not the one you're describing, in that case 978521649
is no longer imported and:
osm_test_buildings_poly
is now an empty tableosm_test_buildings_geom
contains only -13155725
as POLYGON EMPTY
Again, this is not a multipolygon relation but a 3D building relation (with building parts): https://wiki.openstreetmap.org/wiki/Relation:building#For_3D_modelling
This relation is wrongly processed as multi polygon, that's why I have a POLYGON EMPTY
as a result, all the parts are considered as holes, making the whole polygon disappearing.
all the parts are considered as holes, making the whole polygon disappearing.
Right.
The examples in the linked wikipage shows that the tags should be on the outer way and the relation should just contain type=building.
The examples in the linked wikipage shows that the tags should be on the outer way and the relation should just contain type=building.
Yes, the general consensus with Simple 3D Building relations is that the tags related to the entire building should be on the relation member with role=outline, not on the type=building relation definition, as is the case in this example. Putting the data on the member with role=outline makes it far more easy for data consumers to process the building data in OpenStreetMap, as they are not forced to process every single type=building relation, but can rely on simpler processing of ways only for building data (which will include the ones with role=outline).
Yes ok I understand, but why am I getting empty geometries ?... Is it a normal behaviour ?...
I just found out that the geometry mapping is also producing POLYGON EMPTY
on some relation such as relation/12240295
So this may not be linked to building after all.
Context
I'm trying to import buildings/polygons from OSM, some of them are defining multi part buildings (with parts of different heights/levels).
I tried to import the data using
polygon
andgeometry
mappings, they both fail with different behaviors:POLYGON EMPTY
geometryMy example is relation/13155725, you can get download the gzipped data from direct dowload relation-13155725.osm.pbf.gz and relation-13155725.osm.xml.gz or get the XML from overpass using this query:
I did some experiments (removing some parts) and it seems that the member of a relation
type=building
with therole=part
is considered as a inner hole of a multi polygon. Since in this example the union of all parts equals the outline, the polygon disappear, that's why the result isPOLYGON EMPTY
.I need both of the geometries for their tags and sometime relations have more information than outlines.
Expected Behavior
When getting data for both tables
osm_test_buildings_geom
andosm_test_buildings_poly
, the geometry should be (at least) the outline polygon.Actual Behavior
Possible Fix
Filter
role=parts
members when creating buildings. This will result to have two polygons, the outline (if the tagbuilding=*
is present) and the relation.A workaround for those passing by is using a relation mapping and doing an
SQL JOIN
.Steps to Reproduce
Mapping configuration:
osm_test_buildings_geom
should have 2 geometries, way/978521649 with the correct geometry and relation/13155725 with an empty polygonosm_test_buildings_poly
should have 1 geometry, way/978521649 with the correct geometryYour Environment