1

I have seen Downloading Subarea vs Clipping Images to AOI using Planet API? and I still do not feel satisfied with the answer so raise this again.

So what is really the difference between them? @bosth in their answer said

An important distinction is that the Clip API will be decomissioned in favour of other means of downloading parts of images, but the documentation is still there for existing users to reference. Currently, it is recommended that new users employ the subarea method.

I think the difference is Clip to AOI clip right at the server side, at the API endpoint https://api.planet.com/compute/ops/clips/v1/ and you not only download small size image but also pay for small size footprint/area why with the Subarea you pay for the whole scene footprint/area of 220km2 even if you clip only 1km2 out and download. In my case, when I activate the scene, get the download link, pass it to VSICURL and use gdal.warp() Planet actually calculate the area of whole scene and accumulate in my Used Area. The only thing good with Subarea is that you download the small size image which is faster, low bandwidth and reduce your local storage.

And if Clip API will be decommissioned (or has already!) then the only way to clip and download is Subarea, which seems not to save your Km2 quota.

Does anyone know the correct answer/explanation for this case?

  • Have you tried to ask directly from Planet support.planet.com/hc/en-us/requests/new? – user30184 Oct 30 '18 at 7:45
  • To be honest, Planet support has a very slow response. I do not know why. I find much more useful help from people in this forum. I have test the Clips API and it returned blank downloaded tif file. And yes, it had been decommissioned since May 2018. Subarea downloading looks like the only way to get clipped image. And if they charge you by scene's footprint then there is no quota saving at all. – user111189 Oct 30 '18 at 9:20
2

It is correct that the two ways of clipping treat your quota consumption differently. You are free to continue using the Clip API with the understanding that it will be decommissioned and replaced with a new way of server-side clipping. To start doing things the "new way", please see the documentation here.

Example from the documentation:

{
  "name": "just clip",
  "products": [
    {
      "item_ids": [
        "20170614_113217_3163208_RapidEye-5"
      ],
      "item_type": "REOrthoTile",
      "product_bundle": "analytic"
    }
  ],
  "tools": [
    {
      "clip": {
        "aoi": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -163.828125,
                -44.59046718130883
              ],
              [
                181.7578125,
                -44.59046718130883
              ],
              [
                181.7578125,
                78.42019327591201
              ],
              [
                -163.828125,
                78.42019327591201
              ],
              [
                -163.828125,
                -44.59046718130883
              ]
            ]
          ]
        }
      }
    }
  ]
}

Note that using VSICURL for clipping is not a Planet service; it simply relies on the fact that GeoTIFF data in cloud storage can be accessed with range requests.

| improve this answer | |
  • Hi @bosth! I have tried the Clips v1 API and get the download link as the clip-images-to-aoi tutorial showed. However, when I pasted the link to browser, I got http error 414. And if I used urllib.urlretrieve(url, path, .tif) and I got a blank, 0 Mb size tif. The endpoint is still alive, I do not know if it still clip the image or not :), seems like "Clip n Ship" service has been down. And with the Orders v2 API that you shared the link, the overview said Python-based SDK will be next step. I do not know if it is out there and do you have any example or tutorial for it? Thanks! – user111189 Oct 30 '18 at 21:33
  • A Python client for Orders v2 isn't out yet and still might be a while but there are a number of examples of how to construct orders that will modify data (including clipping). – bosth Oct 30 '18 at 21:46
  • A 414 error is "URI too long", which suggests that somehow the download URL that you are getting is corrupt somehow. It'll be hard to diagnose on a public forum however. I'd suggest checking out the new Orders API, however. – bosth Oct 30 '18 at 21:57
  • Hi @bosth, I'm playing a bit with Orders v2 and it was ok for a while, then yesterday I got the response code 400 with the same setting that worked successfully before. clip_result = requests.post( 'api.planet.com/compute/ops/orders/v2', auth=HTTPBasicAuth('MyAPI', ''), json=clip_request) and the response json is {u'message': u'Unable to parse JSON payload. Confirm syntax and schema.', u'code': 400} Have you got any idea what happen with the v2? Thanks man! – user111189 Nov 1 '18 at 20:42
  • Hi @user11189, this will be a bit tricky to do on a public forum. Could you mark this question as solved and email Planet support and we can look into it there? – bosth Nov 1 '18 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.