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

Building outlines do not contain their holes. #88

Closed
tillnagel opened this issue Feb 19, 2015 · 2 comments
Closed

Building outlines do not contain their holes. #88

tillnagel opened this issue Feb 19, 2015 · 2 comments

Comments

@tillnagel
Copy link

In the docs you state that polygons "represent building outlines" and include "building footprint at lower zoom levels, and individual building:part geometries [...] at higher zoom levels."

However, it seems it seems you do not use multi-polygons for buildings having outer and inner features, e.g. for inner court yards, etc. Any way of accessing these via your vector tiles?

Example:
http://vector.mapzen.com/osm/buildings/18/140827/85996.json

@bcamper
Copy link
Collaborator

bcamper commented Feb 19, 2015

Hi Till -- the inner ring information is encoded in the vector tiles, but the confusion probably arises from how this data is stored natively in OSM. "Proper" GIS polygons have a concept of multiple rings in a single polygon (not multipolygon!), where the first ring is the outer ring, and subsequent rings are inner rings which are "cut out" of the outer one. A multipolygon is a separate concept, for spatially disjoint polygons (each of which can have its own outer and inner rings).

Since OSM only has single-ring "ways", they have no native way of encoding multi-ring polygons, hence they use what they call "multipolygon" relations to encode this information. When this data is imported into postgis with osm2pgsql, those OSM multipolygon relations get converted into multi-ring polygons, or true multipolygons where they do not overlap. Some info in the docs here.

In these vector tiles, those features are exposed as GeoJSON polygons (which can have multiple rings, as in the building example you give) and disjoint multipolygons. You can see that building rendering correctly with inner courtyards here: http://tangrams.github.io/tangram/#mapzen,52.49877546805041,13.397671580314638,17

Hope that helps! I'm going to close this issue but feel free to follow up with any clarifications or issues here. Thanks.

@bcamper bcamper closed this as completed Feb 19, 2015
@tillnagel
Copy link
Author

Oh boy. Thanks very much for the explanation. I forgot about them. (It just seems so unsemantic.)

Anyway, glad to hear. Then it's simply a bug in my GeoJSON parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants