List Mosaic Quads

Hello, 

I'm working in Python 3.7.2 and attempting to use the 'List Mosaic Quads' API provided here

I believe I have access to the mosaics through an E&R Departmental account. I can view and download the quads using the planet.com/explorer interface at this link.

However, when I try to search for the imagery in python, I get the following error:

{"message":"Mosaic Not Found: global_quarterly_2016q4_mosaic"}

Why is the mosaic not found? My code is below for reference

import os
import requests

api_key = 347e992b4160ba495afd715f128ee483 # (this is not my real key)

mosaic_id = 'global_quarterly_2016q4_mosaic'
url = 'https://api.planet.com/basemaps/v1/mosaics/' + mosaic_id + '/quads'
parameters = {
"bbox" : "-59.66,13.03,-59.40,13.35",
"minimal" : "TRUE"
}

result = \
requests.get(
url,
auth=requests.auth.HTTPBasicAuth(api_key, ''),
params=parameters)

print(result.text)
0

Comments

1 comment
  • Official comment

    Hi Hannah, sorry for not getting back to you sooner!

    The mosaic_id is an unique identifier for every generated mosaic (e.g. 858fee97-b5c9-4e01-9fe6-59d48ba178a5 which refer to global_quarterly_2018q1_mosaic).

    To look up the mosaic_id in your case for global_quarterly_2016q4_mosaic , you can put the address below in your browser:

    https://api.planet.com/basemaps/v1/mosaics?&name__is=global_quarterly_2016q4_mosaic

    and it will return the mosaic metadata (including the quads url) like this:

    {
    "_links": {
    "_self": "https://api.planet.com/basemaps/v1/mosaics"
    },
    "mosaics": [
    {
    "_links": {
    "_self": "https://api.planet.com/basemaps/v1/mosaics/55696e0b-5c9b-4b76-9307-7faca1f08b64",
    "quads": "https://api.planet.com/basemaps/v1/mosaics/55696e0b-5c9b-4b76-9307-7faca1f08b64/quads?bbox={lx},{ly},{ux},{uy}",
    "tiles": "https://tiles.planet.com/basemaps/v1/planet-tiles/global_quarterly_2016q4_mosaic/gmap/{z}/{x}/{y}.png"
    },
    "bbox": [
    -180,
    -56,
    180,
    76
    ],
    "coordinate_system": "EPSG:3857",
    "datatype": "byte",
    "first_acquired": "2016-10-01T00:00:00.000Z",
    "grid": {
    "quad_size": 2048,
    "resolution": 4.777314267823516
    },
    "id": "55696e0b-5c9b-4b76-9307-7faca1f08b64",
    "interval": "3 mons",
    "item_types": [
    "PSScene3Band",
    "REOrthoTile"
    ],
    "last_acquired": "2017-01-01T00:00:00.000Z",
    "level": 15,
    "name": "global_quarterly_2016q4_mosaic",
    "product_type": "timelapse"
    }
    ]
    }

    Then you can use the quads url to get the list of mosaic quads on your script.

    I hope this helps.

     

    Best regards,

    Emir

Please sign in to leave a comment.

Didn't find what you were looking for?

New post