Comments (12)
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:
row = ((90 - lat) * (2 ** level)) // 288
col = ((180 + lon) * (2 ** level)) // 288
from onearth.
@lucianpls oh big thanks it works π !
I've spent weekend on it trying understand why it doesn't work π« , you should put this magic number into wiki of GIBS or something like that, it will be very helpful
from onearth.
If you fetch and process the WMTS capabilities response from GIBS, you'll find all the information there, just as the standard requires. But there are hardly any software clients that do that, most expect a binary division of the whole world. Which only works for global projections and for a fixed set of resolutions.
If you have real data and you don't want to distort it too much, using custom tiling grids is the only choice.
from onearth.
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.
from onearth.
hm, sadly I'm not so deep in GIS yet. What do you mean by a binary division of the whole world.
?
Could I find any article with recommendations -- what is the best way (best practice) to prepare GIBS data to work with? I'm using python related libs (numpy, scipy, pandas, tensorflow and etc)
from onearth.
Thanks! Yes, I'm using both projections and going to try EPSG:3413
and EPSG:3031
as well. Btw could you point which transformation could I use for them and do they have additional coefficients like EPSG:4326 has?
Btw, I know it is completely unrelated to current issue, but is these issues good place for asking questions slightly related to how is it better to work with NASA GIBS?
- I'm trying to show gif animation of Earth random rectangle area. Thanks to you I've found how to get tile by location (bbox) but is there any tool which sticks and animates GIBS tiles?
from onearth.
from onearth.
@jeffreyrhall @lucianpls thanks for your help! btw after some searching I've found that other folks use another much more useful API, based on https://gibs.earthdata.nasa.gov/image-download endpoint. I wonder why I can't find any information about this endpoint on noted wiki https://wiki.earthdata.nasa.gov/ or official NASA pages?
from onearth.
That endpoint is not a standards-based service and is not an official GIBS imagery endpoint. Obviously, we're not obscuring its existence for those that can sniff it out in the web traffic. Access methods such as the GDAL WMS driver described previously leverage our more efficient tile-based APIs. Image download currently does not, which has performance implications for both server and client. This is something we may formally support in the future, but for now it is not advertised.
With regards to providing a simple way to get the tile for a specified lat/lon/zoom... others have provided the math in here. However, this is one of those things that it would be nice if we had a script in our toolkit that one could run. I know I would benefit. Feel free to contribute to the open source project if you want! :)
from onearth.
@mcechini Big thanks for your help! I love NASA open data, and I like hack it :).
And actually these issues are part of my space apps challenge project https://github.com/botstory/nasa-bot where I try to create chat bot assistant to GIBS dataset :). I thought it would be much easy but stuck exactly on trying to show right map region by coords so noted endpoint https://gibs.earthdata.nasa.gov/image-download would save a lot of time on prototyping phase. But actually I have almost done client to download and compose map animation and once it would work property I could extract it to separate python utility/service which could be used for creating map animation. Hope I'm not reinventing the wheels :)
from onearth.
Sounds like great work. If there are things you want to contribute back to the project, we can take a look if there is a place for it.
from onearth.
@mcechini thanks! I will ;)
from onearth.
Related Issues (20)
- ERROR:root:mrf_insert tool cannot be found. - Exiting. HOT 1
- what's this pictureοΌ notr error but HOT 3
- Serving data in the geostationary projection HOT 8
- How can I use this repository? HOT 2
- update boto3 (onearth/docker/deps /requirements.txt) HOT 1
- Error in oe_generate_legend.py creating legend for xml with one value in final colormap entry
- Error in oe_generate_legend.py creating legend for xml with one value in final colormap entry HOT 2
- Ascii error with oe_generate_legend.py HOT 1
- Invert tick labels for display on dark background in oe_generate_legend.py HOT 2
- My WMS subdaily layer problem HOT 7
- OnEarth and Object Storage HOT 3
- [mrfgen] mrf_merge=True not applying nodata value
- oe_utils missing in mrfgen.py HOT 1
- mrfgen creates empty files HOT 3
- [oe_configure_layer] 'timeElements' is not defined
- WFS time filtering and map variable HOT 3
- [ Documentation ] vectorgen XML file : output_format HOT 1
- OE2 date / roadmap HOT 3
- Question: comparison to geoserver? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onearth.