Mapbox-gl-js: GeoJSON MultiPolygon Not Rendering Properly

Created on 13 Sep 2017  路  1Comment  路  Source: mapbox/mapbox-gl-js

I have a GeoJSON feature that isn't rendering properly.

It's a simple MultiPolygon, with three building footprints. I'll copy it in the bottom of this issue.

The issue is that only the first building is 'filled' and the others are outlined only. When extruded, things get weirder.

I've set up a reproducible error here: Link to JSFiddle: https://jsfiddle.net/5bfo9ex9/4/

I've tested the GeoJSON feature in GeoJSON.io and you can view that here: http://bl.ocks.org/d/e7524fe9c7f1b86dd87a7831afb01d08

MapBoxGL version v0.39.1:

Steps to Trigger Behavior

  1. Load the GeoJSON file as a geojson layer in MapBoxGL
  2. Note that there is only one building of the three that is filled.

Expected Behavior

image

Actual Behavior

image

{"type":"MultiPolygon","coordinates":[[[[115.813867,-31.932177],[115.813867,-31.932177],[115.813867,-31.932087],[115.813962,-31.932087],[115.813962,-31.932124],[115.814005,-31.932124],[115.814005,-31.932168],[115.813962,-31.932168],[115.813962,-31.932177],[115.813867,-31.932177]],[[115.813962,-31.932087],[115.813894,-31.932087],[115.813894,-31.932042],[115.81391,-31.932042],[115.81391,-31.931967],[115.813984,-31.931967],[115.813984,-31.932042],[115.81401,-31.932042],[115.81401,-31.932087],[115.813962,-31.932087]],[[115.81391,-31.931967],[115.81391,-31.931931],[115.813849,-31.931931],[115.813849,-31.9319],[115.81386,-31.9319],[115.81386,-31.931868],[115.813984,-31.931868],[115.813984,-31.931967],[115.81391,-31.931967]]]]}

Most helpful comment

The geometry of your MultiPolygon is invalid: it purports to consists of a single Polygon with an outer ring and two inner rings, but the inner rings are not contained within the outer ring. Here's a corrected example, with three simple polygons instead, which is probably what you intended: https://jsfiddle.net/5bfo9ex9/5/

>All comments

The geometry of your MultiPolygon is invalid: it purports to consists of a single Polygon with an outer ring and two inner rings, but the inner rings are not contained within the outer ring. Here's a corrected example, with three simple polygons instead, which is probably what you intended: https://jsfiddle.net/5bfo9ex9/5/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rasagy picture rasagy  路  3Comments

stevage picture stevage  路  3Comments

yoursweater picture yoursweater  路  3Comments

aderaaij picture aderaaij  路  3Comments

samanpwbb picture samanpwbb  路  3Comments