Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Broken polygon rendering #1067

Closed
kristfal opened this issue Mar 23, 2015 · 4 comments
Closed

Broken polygon rendering #1067

kristfal opened this issue Mar 23, 2015 · 4 comments
Labels

Comments

@kristfal
Copy link

Hello,

the native iOS client seem to have issues rendering certain polygons. We can't really identify why or under which circumstances it triggers, but it is a bug not found in the web client. Here are some screenshots, description below.

ios simulator screen shot 20 mar 2015 18 00 35
screenshot 2015-03-23 17 03 40

ios simulator screen shot 20 mar 2015 18 01 15
screenshot 2015-03-23 17 03 09

The red layer is our land-layer from a custom data source. The data is initially stored in a postGIS db, and validated with ST_IsValid.

The poly should cover all the brown areas, which is the map background color. The first screenshot in each pair is from the native client, the other is from the web client covering the same location. Style and source is identical.

As you can see, a lot of red polys are missing in the native client. The web client has no issues rendering these polys.

The straight lines that cut through large polys are cutting lines in the custom dataset, which leads us to believe that the iOS client is dropping certain polys all together.

We don't have more information than this to go on, we'll start experimenting with various preprocessing steps such as cutting and merging the polys before building the pbf-tiles.

The data is custom, but we'll be more than happy to provide pbf samples, styles and postGIS db-extracts in private.

@kristfal
Copy link
Author

Update, managed to find a workaround.

The initial data is "tiled" like this:

mapbox data

Which in turn causes the native client to completely drop rendering certain polygons:

unnamed

We then meged the polygons to a single multipolygon before exporting to mbtiles:

mapbox data merged

Which in turn led to proper rendering:

db

The layer contains only geometry, no attributes fields are passed through the MBS export in either case, so it seems like a pure geometry issue. We can share both sources if you need debug material. Again, the js-client has no issues rendering either data source.

@kkaefer
Copy link
Member

kkaefer commented Mar 26, 2015

I'd be interested in the sample material. Can you please send them to konstantin (at) mapbox.com? The JS renderer uses different approach to polygon rendering which doesn't involve tessellation. However, that will change soon since rendering is faster with properly tessellated polygons.

@kristfal
Copy link
Author

@kkaefer We fixed this in the data by running ST_ForceRHR on the polys. That should probably narrow your search ;)

@incanus incanus added the bug label Mar 30, 2015
@jfirebaugh
Copy link
Contributor

Yes, RHR is required. Tracking this upstream in mapbox/vector-tile-spec#18 and mapbox/mapnik-vector-tile#59.

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

No branches or pull requests

4 participants