1

The Tiles in a database files has values for a tile like at zoom level 13 column 5869 and row 3370. However the leaflet and python generates the tile number as column 4782 and row 1162 at zoom level 13. The coordinates for both cases(tiles generated and in leaflet) are same as 77.970736, 30.146494 and zoom level 13.

var map = L.map('map').setView([77.970736, 30.146494],13);
    // var map = L.map('map').setView([0, 0],13);


     //  L.tileLayer('four.gpkg/{z}/{x}/{y}.png', {
    L.tileLayer('four.gpkg?table=tiles&z={z}&x={x}&y={y}', {
        maxZoom: 15,
   }).addTo(map);

Results from leaflet Web Console for a tile

<img class=""  /mygpkg.gpkg/13/4782/1162.png"></img>

But from database

Zoom level | tile_column | tile_row |tile_data

13 | 5869 | 3370 | BLOB

Attempts:

  1. Tried to change the values in the leaflet.

  2. Tried to redownload the tiles, from different sources.

All attempts have given no proper results.

The database is GeoPackage that has structure as above.

Projection:Tiles were generated using Mobile Atlas Creator(MOBAC), so its WGS84,as it shows in the MOBAC.

Tiles were converted using GDAL as well as from cloud service. But the problem remains same.

  • What's your database? How are you exactly generating your tiles? What's the map projection? – IvanSanchez Jan 10 '18 at 10:22
  • Thank you for your comments to add further information. Edits were done.. – Aaron Jan 11 '18 at 8:40
  • OK, that helps. But... what's the projection of your tiles? – IvanSanchez Jan 11 '18 at 8:52
  • 1
    And you've noticed that Leaflet is using EPSG:3857 (spherical mercator) instead of EPSG:4326 (WGS84 lat-long), right? – IvanSanchez Jan 12 '18 at 11:34
  • Thanks for your comment, i realized that the web Mercator is used everywhere. leaflet also uses the same and MOBAC that download data from OpenStreetMap uses the web Mercator projection – Aaron Jan 13 '18 at 14:42

Your Answer

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

Browse other questions tagged or ask your own question.