How could I get right tile (WGS 84 / Lat-lon / Geographic / EPSG:4326) by long, lat and zoom?
See original GitHub issueI’m trying to get tile by long, lat and zoom by formula:
row = int((90 - lat) / 180 * 2 ** zoom)
col = int((180 + lon) / 180 * 2 ** zoom)
but it doesn’t work. Here is related question https://gis.stackexchange.com/questions/239496/how-to-convert-long-lat-to-a-tile-of-nasa-gibs-wgs-84-lat-lon-geographic
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Converting long, lat to tile of NASA GIBS - WGS 84 / Lat-lon ...
I've gotten comment from Lucian member of NASA team. For GIBS GCS, the level 0 resolution is 288 deg / tile, not 180...
Read more >Map and Tile Coordinates | Maps JavaScript API
Tile coordinates, which reference a specific tile on the map at a specific zoom level.
Read more >Zoom levels and tile grid - Azure Maps
Learn how to set zoom levels in Azure Maps. See how to convert geographic coordinates into pixel coordinates, tile coordinates, and quadkeys ...
Read more >Spatial references | Documentation - ArcGIS Developers
A spatial reference defines the coordinate system used to locate the geometry for a ... Typically GCSs use latitude and longitude specified in...
Read more >Tiles à la Google Maps: Coordinates, Tile Bounds and ...
Convert coordinates for using global map tiles. Map of Earth. Degrees Geodetic coordinates WGS84 (EPSG:4326). Longitude and latitude coordinates ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For GIBS GCS, the level 0 resolution is 288 deg / tile, not 180 deg/tile. It was chosen to approximate the full resolution of the MODIS images, avoiding oversampling or undersampling, while still having full width tiles at most levels (2 and up).
Making this adjustment, the formula to use is:
Web Mercator assumes the world map fits in a square tile of 256x256, then keeps subdividing. There is also a GCS grid where the whole world fits in two tiles side by side at top level, the way your original formula works. There are no partial content tiles ever. Those are the most common tiling schemes.
You might want to look at GDAL, it has python bindings and knows how to fetch the data from GIBS, using the GDAL WMS, hiding the tiling aspect.