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

Areas marked as buildings #227

Closed
jacopofar opened this issue Feb 20, 2022 · 7 comments
Closed

Areas marked as buildings #227

jacopofar opened this issue Feb 20, 2022 · 7 comments
Labels
bug Something isn't working
Milestone

Comments

@jacopofar
Copy link
Contributor

What version of PgOSM Flex are you using?

The current one from Docker hub, e4a19009b701

What operating system, osm2pgsql, and PostgreSQL/PostGIS versions are you using?

The included PostGIS 12 + PostGIS 14, but the problem is probably in the Lua scripts

What did you do exactly?

I imported the 2022-02-19 Geofabrik export of Berlin, Germany, then visualized it in QGIS.

Issue description

After importing the file for the city of Berlin, I noticed that the building_polygon table contains a few polygons that are not bulding but rather city areas.

grafik

I'm not sure this is not the intended behavior, these are the not buildings but boundaries of postal codes. Not all the postal codes appear as buildings, only 3 of them:

https://www.openstreetmap.org/relation/1405771
https://www.openstreetmap.org/relation/1405640
https://www.openstreetmap.org/relation/1405638

they all have the attribute boundary=postal_code and type=boundary. The other postal codes end up in the place_polygon table, for example these ones:

https://www.openstreetmap.org/relation/1397900
https://www.openstreetmap.org/relation/1397881

The only common denominator I can see for the three postal codes above marked as buildings is that they have addr:city=Berlin while the ones marked as places do not.

@jacopofar
Copy link
Contributor Author

Sorry, nevermind, I realized I was using a 4 months old Docker image. I have to adapt my scripts to the new one to check whether the issue is still there, there's no more run-all.lua`

@rustprooflabs
Copy link
Owner

I suspect this is still a problem in the latest too. What's the value of the osm_type for those records? I'd guess it is osm_type='address', if so it's being caught by logic added in #97.
The decision to include/exclude address only "building" objects is handled here: https://github.com/rustprooflabs/pgosm-flex/blob/main/flex-config/style/building.lua#L54-L78

That includes the comment:

    -- Opting to include any addr: tag that was not excluded explicitly above
    --   This might be too wide of a net, but trying to be too picky risks
    --   excluding potentially important data

My initial hunch is the best approach would be to exclude the boundary=postal_code attribute, or even a wider net of exclusion using any boundary tag. The other option would to try to make the selection of addr: tags more specific, though I think this approach is trickier than excluding records we do not want in buildings.

@rustprooflabs rustprooflabs added the bug Something isn't working label Feb 20, 2022
@jacopofar
Copy link
Contributor Author

After #228 it looks like this:

grafik

@jacopofar
Copy link
Contributor Author

I checked the database importing with both versions, and I don't see anything removed but the three post codes

grafik

@rustprooflabs
Copy link
Owner

Fixed in #228 and #230. Merged into dev branch and available on Docker Hub docker pull rustprooflabs/pgosm-flex:dev hash 046bfa49decf. Will merge into main branch and latest image soon.

@rustprooflabs
Copy link
Owner

The dev docker image has been updated to hash 6f7049ed72ae -- includes #232 to fix issue with absolute path and --input-file reported in #229.

@rustprooflabs
Copy link
Owner

This is merged into main branch, pushed updated :latest Docker image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants