Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osm2pgsql applies building=yes to all members of a multipolygon (for some relations). #52

Closed
skorasaurus opened this issue Jul 16, 2013 · 2 comments

Comments

@skorasaurus
Copy link

I'm running postgis 2.0.1, psql 9.1.9, master of osm2pgsql, ubuntu 12.04, 64bit.

Note this problem does not occur for people using 0.81.

SELECT landuse, building FROM planet_osm_polygon WHERE osm_id=-2901483;
SELECT landuse, building FROM planet_osm_polygon WHERE osm_id=-2915918;
SELECT landuse, building FROM planet_osm_polygon WHERE osm_id=-2934273;

First query returned landuse=residential,
2nd query, blank on both,
both were expected behaviors, but in this third query,
for this relation, I received a landuse=residential and building=yes
even though this relation was a type=multipolygon relation.

Building=yes is attributed for all polygons in this relation although these member areas are not all buildings.

I realize these relations, created for the HOT task manager, are hackish, but they may be other use cases where this happens.

@apmon
Copy link
Contributor

apmon commented Jul 19, 2013

The culpable code is likely https://github.com/openstreetmap/osm2pgsql/blob/master/tagtransform.c#L525

If it encounters a multipolygon relation with no tags of its own, it copies all of the tags of the outer member ways over and applies it to the multipolygon. So as long as the multi-polygon doesn't have its own tags and there is at least one outer way with building=yes, then the polygon in the db will have building=yes set.

I am not sure if this is actually a bug. If the outer ways aren't all of identical type, then the multi-polygon probably really should have the relevant tags set directly.

The new lua based tagtransform behaves slightly different in this respect by default (as I am not sure there is a well defined behaviour in these cases). Furthermore, there you can specify exactly how you want it to behave in the lua script.

@lonvia
Copy link
Collaborator

lonvia commented Dec 22, 2018

Fixed by dropping all old-style multipoygon handling.

@lonvia lonvia closed this as completed Dec 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants