3

I'm having an issue uploading a large polygon tileset to mapbox studio from an R simple features object. From R i've projected my simple features to web mercator and i've tried saving either as shp (zipped) or geojson. All my polygons are rectangular bounding boxes. Everything looks fine in R and QGIS.

But viewed in MapBox studio, you can see that the polygons have been distorted with some vertices removed, turning them into triangles, other polygons are entirely missing. Has anyone seen this before? I know that tilesets undergo "simplification"

https://docs.mapbox.com/help/how-mapbox-works/uploading-data/#how-data-becomes-a-tileset but i'm surprised that vertices are removed and the shape is changed.

enter image description here

Here is same area in my shiny app, same simple features file, adding the polygons directly from leaflet (addPolyLines) and grabbing the mapbox tiles.

enter image description here

EDIT:

It was suggested that a change in zoom would show the bounding boxes. This is not true. Here is the closest zoom level

enter image description here

and furthest zoom level

enter image description here

Also there are many polygons missing. I am not seeing a maximum vertices specification, I will test with with just a handful of polygons and edit the question.

May be related to this thread: https://github.com/mapbox/mapbox-gl-js/issues/9085

2nd Edit.

My sense is this is genuine bug. As far as i can tell, combining data from wide geographic areas causes this problem. Here is a screenshot that helps demonstrate this.

enter image description here

In blue is an upload covering polygons from across the continental US at different sites in one .shp. Polygons were projected to web meractor, from their appropriate utm coordinates in R before upload.

In red is the same upload script, but the polygons come from the same utm zone. Distortion only happens when the tileset covers a wide geographic area. I am submitting a mapbox studio ticket.

  • Probably that zoom level just does not suit with your data. A vector tile has limited number of integers to be used for the vertices docs.mapbox.com/vector-tiles/specification. With higher zoom levels there should be no problem If you need to visualize the data with low zoom levels it migh help to convert boxes into points (centroids). – user30184 Feb 21 at 9:30
0

All of this is happening because Mapbox is converting your vector data into vector tiles and you don't have much control over the process.

The best approach is to use Tippecanoe to process your data into vector tiles yourself, then upload the result.

Notice options like:

--no-tiny-polygon-reduction: Don't combine the area of very small polygons into small squares that represent their combined area.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.