Closed maxmiranda closed 2 years ago
I no longer work at Mapbox, but the problem is probably that your polygons are too small to be visible in z5 tiles. It looks like this one is about 400 feet tall, but z5 has a precision of about 1000 feet at best. The same polygon processed with tippecanoe
does not show up until zoom level 8.
Thank you for the advice @e-n-f, per your suggestion, I tried modifying recipe to increase minzoom to 14 and maxzoom to maximum (16). Unfortunately, got the exact same error even after I confirmed recipe got updated properly. Note that each of the polygons I'm trying to plot are the tiles that are rendered at zoom level 18 (photo attached). Any other guidance on why this might not be working?
It looks like the problem may be that your polygons are not closed. A GeoJSON polygon representing a square is supposed to include five coordinate pairs, with the first coordinate pair duplicated as the last coordinate pair. Yours only have four coordinate pairs, all unique, so MTS is probably rejecting the geometry as invalid.
https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6
3.1.6. Polygon
To specify a constraint specific to Polygons, it is useful to
introduce the concept of a linear ring:
o A linear ring is a closed LineString with four or more positions.
o The first and last positions are equivalent, and they MUST contain
identical values; their representation SHOULD also be identical.
@e-n-f THANK YOU SO MUCH!!! that's exactly right, I appreciate your quick response times & if anyone who currently works on Tilesets CLI sees this, I would recommend adding a similar check to the validation for uploading source files if that's indeed going to be required when processing the source!
Thanks @e-n-f @maxmiranda for the help and conversation here! I'm commenting here to remind myself that we should consider using the official geojson schema for validation, instead of our own written jsonschema document https://github.com/geojson/schema
This at least enforces a minimum number of LinearRingCoordinates. It doesn't exactly check the first and last values are matching, but we'd improve the validation logic a little by moving this way.
Following the tutorial here https://docs.mapbox.com/help/tutorials/get-started-mts-and-tilesets-cli to try to upload my GEOJson file to a tileset.
Ran the following commands to get this output:
tilesets validate-source cupertino.geojson
Validating features ✔ valid
tilesets upload-source maxmiranda cardio-grid cupertino.geojson
{"id": "mapbox://tileset-source/maxmiranda/cardio-grid", "files": 1, "source_size": 743104, "file_size": 743104}
tilesets create maxmiranda.cardio-grid-tiles --recipe cardio-grid-recipe.json --name "cardio grid"
{"message": "Processing maxmiranda.cardio-grid-tiles", "jobId": "cl275u142000309mr24uqgf7m"}
✔ Tileset job received. Visit https://studio.mapbox.com/tilesets/maxmiranda.cardio-grid-tiles or run tilesets job maxmiranda.cardio-grid-tiles cl275u142000309mr24uqgf7m to view the status of your tileset.
{ "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": {}, "geometry": { "coordinates": [ [ [ -122.09381103515625, 37.34177550214858 ], [ -122.09381103515625, 37.34068368469043 ], [ -122.09243774414062, 37.34068368469043 ], [ -122.09243774414062, 37.34177550214858 ] ] ], "type": "Polygon" } },