Giter Club home page Giter Club logo

Comments (12)

lucianpls avatar lucianpls commented on July 29, 2024 2

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.

hyzhak avatar hyzhak commented on July 29, 2024 1

@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.

lucianpls avatar lucianpls commented on July 29, 2024 1

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.

lucianpls avatar lucianpls commented on July 29, 2024 1

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.

hyzhak avatar hyzhak commented on July 29, 2024

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.

hyzhak avatar hyzhak commented on July 29, 2024

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.

jeffreyrhall avatar jeffreyrhall commented on July 29, 2024

from onearth.

hyzhak avatar hyzhak commented on July 29, 2024

@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.

mcechini avatar mcechini commented on July 29, 2024

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.

hyzhak avatar hyzhak commented on July 29, 2024

@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.

mcechini avatar mcechini commented on July 29, 2024

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.

hyzhak avatar hyzhak commented on July 29, 2024

@mcechini thanks! I will ;)

from onearth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.