Cheat Sheet: Planet Command Line Interface

Comments

9 comments

  • Daniel Rodriguez

    Hello Samapriya

    Is this the correct syntax to Batch Download Images

    C:\>planet data download --item-type 'PSScene3Band' --asset-type 'analytic' --date acquired gt '2019-01-01' --date acquired lt '2019-03-29' --range cloud_cover lt '0.2' --geom 'C:\razortek\year2019\projects\tulsa\texoma.json' --dest 'C:\razortek\year2019\projects'

    Am I missing something in the syntax following the above example

    planet data download --item-type 'PSScene3Band' --asset-type 'analytic' --date acquired gt '2018-01-01' --date acquired lt '2018-02-01' --range cloud_cover lt '0.2' --geom "full path to geometry.geojson" --dest 'full path to folder where you want to download all images'

    When I run the above command I receive the following error

    Error: Invalid value for "item--type": invalid choice 'PSSScene3Band'.

    Am I missing a symbol or selected the wrong symbol?

    Any help would be appreciated.

    Thanks

    Daniel Rodriguez

    0
    Comment actions Permalink
  • Benjamin Trigona-Harany

    Hi Daniel,

    The error message indicates that there was a spelling issue: PSSScene3Band should be PSScene3Band.

    Best,

    0
    Comment actions Permalink
  • Daniel Rodriguez

    I deleted the extra S and still receive the same error mention above?

     

    C:\>planet data download --item-type 'PSScene3Band' --asset-type 'analytic' --date acquired gt '209-01-01' --date acquired lt '2019-03-29' --range cloud_cover lt '0.2' --geom 'C:\razortek\year2019\projects\tulsa\texoma.json' --dest 'C:\razortek\year2019\projects'


    Usage: planet data download [OPTIONS]
    Try "planet data download --help" for help.

    Error: Invalid value for "--item-type": invalid choice: 'PSScene3Band'.
    Choose from:
    MYD09GQ
    PSScene4Band
    SkySatScene
    PSScene3Band
    Sentinel1
    REScene
    REOrthoTile
    Sentinel2L1C
    MOD09GA
    MYD09GA
    SkySatCollect
    PSOrthoTile
    Landsat8L1G
    MOD09GQ

    C:\>

    I am missing a character?

    0
    Comment actions Permalink
  • Benjamin Trigona-Harany

    Hi Daniel,

    I guess on Windows, it might be necessary to remove the ' marks around the parameters. I also see that the date has a mistake that will cause you to download very old data: 209-01-01.

    I also suggest you add a limit to the number of items you download, at least to start:


    planet data download --item-type PSScene3Band --asset-type analytic --date acquired gt 2019-01-01 --date acquired lt 2019-03-29 --range cloud_cover lt 0.2 --geom 'C:\razortek\year2019\projects\tulsa\texoma.json' --dest 'C:\razortek\year2019\projects' --limit 1

    0
    Comment actions Permalink
  • Daniel Rodriguez

    Hello Benjamin

    Thanks for your help on the syntax below

    planet data download --item-type PSScene3Band --asset-type analytic --date acquired gt 2019-01-01 --date acquired lt 2019-03-29 --range cloud_cover lt 0.2 --geom 'C:\razortek\year2019\projects\tulsa\texoma.json' --dest 'C:\razortek\year2019\projects' --limit 1

    When I ran the script it display lat long coordinates inside the dos screen. I have 2 questions

    1. Do you have to specific a json file to dump the coordinates into

    2. after the coordinates were display the message below was displayed

    Error:InValidAPIKey: No API key provided

    Where do I list RazorTek reseller API key in the script?

    Any help would be appreciated.

    Soooo close for the process to run correct.

    0
    Comment actions Permalink
  • Daniel Rodriguez

    Hello Ben

     

    I forgot to login in with my planet username and password.

    I ran the above script and it did select an image based on the parameters listed and downloaded a tiff image question it did not create json file to be converted to a shapefile in ArcMap.

    Do I need to add a .json filename at the end of this command?  --dest 'C:\razortek\year2019\projects'

    Any help would appreciated

    0
    Comment actions Permalink
  • Samapriya Roy

    Hi Daniel,

    There are a couple of things that might help

    The geometry object that you are passing should be a geojson, create one using geojson.io

    The setup you are using will only download the images and not export any geojson.

    planet data download --item-type PSScene3Band --asset-type analytic --date acquired gt 2019-01-01 --date acquired lt 2019-03-29 --range cloud_cover lt 0.2 --geom 'C:\razortek\year2019\projects\tulsa\texoma.json' --dest 'C:\razortek\year2019\projects' --limit 1

    I am not really sure what you are exporting to be used with ArcMap, The tool does not export shapefiles, but you can export the footprints of all the images you want into a GeoJSON file and then open it in geojson.io and export to shapefile

    planet data search --item-type PSScene3Band --asset-type analytic --date acquired gt 2019-01-01 --date acquired lt 2019-03-29 --range cloud_cover lt 0.2 --geom 'C:\razortek\year2019\projects\tulsa\texoma.json' --limit 1 > "path to footprint.geojson"

    Hope that helps

     

    Sam

    0
    Comment actions Permalink
  • Daniel Rodriguez

    Hello Sam

    Thanks for the information. I tried to create geojson file but I am receiving the following error

    Error:Invalid value for "--limit": to it is not valid integer

    Here is the syntax I type

    planet data search --item-type PSScene3Band --asset-type analytic --date acquired gt 2019-03-10 --date acquired lt 2019-03-29 --range cloud_cover lt 0.2 --geom C:\razortek\year2019\projects\omaha\geospencer.json --limit 1>path to C:\razortek\year2019\omaha\footprint.geojson

    Is the syntax path not correct to create the footprint.geojson file or I am missing a character?

    Thanks

    Daniel

    0
    Comment actions Permalink
  • Benjamin Trigona-Harany

    You'll need to add a space before and after the > symbol.

    0
    Comment actions Permalink

Please sign in to leave a comment.