Skip to main content
Solved

How to check if tile is available for zoom, x, y before making API call to get tile

  • 21 December 2023
  • 3 replies
  • 222 views

We are loading PlanetScope and SkySat tiles into an application using Google Maps API V3. It automatically requests tiles via the Planet API based on zoom level and x and y values.

Since Planet scenes may not take up the entire bounding box of the map, we are sometimes calling the API forĀ x and y values that may not produce a tile.

Is there a way of checking ahead of time whether a tile is available at the x and y location so as to reduce the calls to the Planet API if there is no tileĀ there? We call theĀ API on the server so as to hide theĀ API key, then return the resulting PNG file to the browser.

Many thanks for your help,

Dan

3 replies

Userlevel 1
Badge +3

Hey Dan, I am curious which API you are using, I imagine it is the Tile Services API but I was wondering if you were also using the data API?Ā 

Are you streaming Planet Scope Scenes or a basemap product? If you are streaming a basemap product my first guess is that you are zoomed past L16, which is our highest zoom level for basemaps and because of that the tiles arent at your x any y values.Ā 

If you are streaming Planet scope scenes, how are you currently getting the specific scene ID you are trying to stream?

Ā 

Userlevel 7
Badge +15

Hey @Dan CogswellĀ 
Do you still need any assistance?Ā 

Badge +2

Hi--

I donā€™t have a solution, but we can live with the way it works. It was mostly to benefit Planet by not placing so many calls to your API.

Ā 

Thanks,

Dan

Reply