mapbox / mbutil

Importer and Exporter of MBTiles
http://mapbox.com/developers/
BSD 3-Clause "New" or "Revised" License
761 stars 199 forks source link

Exported tiles (to disk) are not visible on the MapboxGL #115

Closed overide closed 2 years ago

overide commented 2 years ago

Hi,

I'm trying to generate mbtiles from geojson and exporting it to disk to visualize on the MapboxGL but nothing appears on the map. I can ensure that the layer configuration on Mapbox is correct and I've checked it using other datasets, I'm able to load vector tiles.

Details about my use case - I'm trying to tile contours generated using ArcGIS, exported contour is in DWG format. So I follow the following process -

  1. Convert DWG to DXF using LibreDWG - https://github.com/LibreDWG/libredwg
  2. Convert DXF to geojson using ogr2ogr
  3. Convert geojson to mbtiles using tippecanoe - https://github.com/mapbox/tippecanoe
  4. Finally export mbtiles to disk using mbutil and serve using our custom server

Till step 3 everything works and I can visualize the generated mbtile using mbview - https://github.com/mapbox/mbview but once I export it to disk and serve it from our server, nothing appears on the map. I also tried to repackage the disk tiles into mbtile and compared with the original mbtile, repackaged mbtile is very small in size compared to the original one. Also, repackaged mbtile is not visible on the map when visualized using mbview. So, I think that something is wrong with exporting.

Please find attached -

  1. original DWG file (EPSG: 32645)
  2. DWG converted to Geojson (EPSG: 4236)
  3. Generated mobile

mbtile command - mb-util --image_format=pbf contours_tiles.mbtiles contours

I also observed that if I don't specify any image_format, then generated disk tiles are correct (but in png, but i need pbf) and after repackaging it back to mbtile it is visible using mbview

Note: While visualizing the provided mbtile in zip file, you have to zoom a little then it'll appear on map

Regards, Atul

dataset.zip

overide commented 2 years ago

Turns out that some sort of filtering was applied to the vector layer (in my frontend codebase) which I was not aware of. Everything is working fine.