create a shapefile from PlanetScope scene coordinates
Is there a way to down the scene coordinates to create a scene polygons overlay before ordering PlanetScope archive imagery?
I remember when you were able to download as RE scene shapefile and overlay a polygon to adjust your aoi before uploading the aoi to select the scenes you needed.
-
Official comment
Daniel,
You can query the data api for products with the "planet" command which returns geojson, then it is easy to change that to a shapefile with ogr2ogr, or use the geojson directly with most applications.
eg.
$ planet data search --item-type PSScene3Band \
--date published gt 2014-01-01 --date published lt 2017-01-01 \
--limit=1000 > result.geojson
$ ogr2ogr -f "ESRI Shapefile" result.shp result.geojson
Warning 6: Field acquired create as date field, though DateTime requested.
Warning 6: Normalized/laundered field name: 'satellite_id' to 'satellite_'
Warning 6: Normalized/laundered field name: 'sun_elevation' to 'sun_elevat'
Warning 6: Normalized/laundered field name: 'pixel_resolution' to 'pixel_reso'
Warning 6: Normalized/laundered field name: 'usable_data' to 'usable_dat'
Warning 6: Normalized/laundered field name: 'ground_control' to 'ground_con'
Warning 6: Normalized/laundered field name: 'anomalous_pixels' to 'anomalous_'
Warning 6: Field updated create as date field, though DateTime requested.
Warning 6: Normalized/laundered field name: 'quality_category' to 'quality_ca'
Warning 6: Normalized/laundered field name: 'sun_azimuth' to 'sun_azimut'
Warning 6: Normalized/laundered field name: 'cloud_cover' to 'cloud_cove'
Warning 6: Field published create as date field, though DateTime requested.
$ ls -l result.*
-rw-rw-r-- 1 frank frank 778802 Mar 21 20:59 result.dbf
-rw-rw-r-- 1 frank frank 1673394 Mar 21 20:59 result.geojson
-rw-rw-r-- 1 frank frank 143 Mar 21 20:59 result.prj
-rw-rw-r-- 1 frank frank 136100 Mar 21 20:59 result.shp
-rw-rw-r-- 1 frank frank 8100 Mar 21 20:59 result.shxIf you have a recent version of GDAL/OGR, you can also use the PLScenes: driver like this to directly create a shapefile.
$ export PL_API_KEY=xxx
$ ogr2ogr -f "ESRI Shapefile" \
query_out.shp \
PLScenes: \
PSScene3Band \
-where "published > '2015-01-01' and published > '2014-01-01'" \
-spat -117 33 -116 34 -limit 1000Comment actions -
Hi Daniel,
Frank's example above is using the "planet" CLI tool to interact with Planet's Data API -- you can learn more about that tool in this recent blog post from Sam Roy: https://medium.com/@samapriyaroy/demystifying-planets-command-line-tool-660870b32317
To learn more about downloading and installing GDAL/OGR, check out this guide: https://developers.planet.com/planetschool/gdal-qgis-installation-setup/
-
Daniel,
I think Sam's post that Sara referenced is the best starting point for someone new to the planet command line interface.
https://medium.com/planet-stories/demystifying-planets-command-line-tool-660870b32317
I had not understood from your first question that you were ideally looking for a solution from within Planet Explorer.
Best regards,
Frank
Please sign in to leave a comment.
Comments
6 comments