Git Product home page Git Product logo

porder's Introduction

porder's People

Contributors

alukach avatar dshean avatar ihinks avatar rbavery avatar samapriya avatar scottyhq avatar tyson-swetnam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

porder's Issues

porder order says invalid geometry but geojsonlinter says is valid

I'm trying the following,

(porder-env) (v2-cloud)~/cloud-free-planet/notebooks$ porder order --name test_tile_eighth_May-September --idlist ~/cloud-free-planet/notebooks/test_tile_eighth.txt --item PSScene4Band --asset analytic_sr --boundary test_tile_eighth_fixed.geojson --op clip

the order fails without returning a url and with the following error

Could not parse geometry
{"field":null,"general":[{"message":"Unable to accept order: geojson: invalid geometry"}]}

But I've checked that my geojson is valid with http://geojsonlint.com/ and no errors from the spec are reported. Any help is appreciated!

My geojson is

{
  "type": "FeatureCollection",
  "name": "test_tile_eighth",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "id": 0
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -0.831053947078279,
              5.72196597574407
            ],
            [
              -0.831,
              5.71
            ],
            [
              -0.815323594266615,
              5.709838158765161
            ],
            [
              -0.815377541344895,
              5.721804134509231
            ],
            [
              -0.831053947078279,
              5.72196597574407
            ]
          ]
        ]
      }
    }
  ]
}

and my id file is attached

test_tile_eighth.txt

I can order without clipping just fine, for now it is clipping to the boundary that causes the order to fail.

bad request, no acceptable assets even though asset set to "visual" or "analytic"

I'm working with a Departmental license but I get this error code for the following order:

porder order --name "Punjab Burns c" --idlist "/home/rave/tana-spin/waves/kelsey_order/idlist-punjabac" --item "PSScene4Band" --bundle "analytic"

Failed with response: Bad request
Order request resulted in no acceptable assets. Likely due to lack of permissions.

This also happens if I change the asset to "visual".

I have a ticket open with Planet support to see if it is an issue on their end but just in case I thought I'd open one here in case anyone has any thoughts on why this is occurring.

Here's my idlist (I renamed with ".txt" to be able to upload to github)
idlist-punjabac.txt

error while running porder for the firrst time

Hei,

I have just installed porder on Mac OSX 10.13.6 with python3.6 but get the error below when running it. Does anyone with more experience know how to fix this?
Thanks for your help,

$ porder
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/porder", line 7, in
from porder.porder import main
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/porder/porder.py", line 5, in
from geojson2id import idl
ModuleNotFoundError: No module named 'geojson2id'

Feature Request: filter porder idlist by sensor view angle

I think this would involve adding a string filter to this section of code in geojson2id

    data = {'filter': {'type': 'AndFilter',
            'config': [{'type': 'GeometryFilter', 'field_name': 'geometry',
            'config': {'type': 'Polygon', 'coordinates': []}},
            {'type': 'OrFilter', 'config': [{'type': 'AndFilter',
            'config': [{'type': 'StringInFilter', 'field_name': 'item_type'
            , 'config': []}, {'type': 'RangeFilter',
            'field_name': 'cloud_cover', 'config': {'gte': [],
            'lte': []}}, {'type': 'RangeFilter',
            'field_name': 'sun_elevation', 'config': {'gte': 0,
            'lte': 90}}]}]}, {'type': 'OrFilter',
            'config': [{'type': 'DateRangeFilter', 'field_name': 'acquired'
            , 'config': {'gte': [],
            'lte': []}}]}]},
            'item_types': []}
## Configure search payload
    data['filter']['config'][0]['config']['coordinates'] = aoi_geom
    data['filter']['config'][2]['config'][0]['config']['gte'] = str(start)+'T04:00:00.000Z'
    data['filter']['config'][2]['config'][0]['config']['lte'] = str(end)+'T03:59:59.999Z'
    data['filter']['config'][1]['config'][0]['config'][1]['config']['gte'] = float(cmin)
    data['filter']['config'][1]['config'][0]['config'][1]['config']['lte'] = float(cmax)
    data['filter']['config'][1]['config'][0]['config'][0]['config'] = [item]
    data['item_types'] = [item]
    data = str(data).replace("'", '"')
    temp['coordinates']=aoi_geom
    gmain=shape(temp)

zipped cloud delivery KeyError

Working @ShashankBice with porder 0.5.5, we encountered an error when issuing an order with zipped asset delivery to an AWS S2 bucket: KeyError: amazon_s3. It seems this was due to the zip configuration dictionary settings overwriting aws configuration settings, since they both sit under a delivery key.

Will follow with a simple PR that fixes this.

porder order returns invalid geometry, also fails without geometry clipping for aws s3

I'm trying the following with the given idlist and geojson (see attached)

porder order --name test-aoi1-month07 --idlist ~/planet/cloud-free-planet/notebooks/test_aoi1_id.txt --item PSScene4Band --asset analytic_sr --boundary test_tile.geojson --aws ~/planet/cloud-free-planet/notebooks/aws.yaml --op aws clip email

But the order status fails (from the email notification)

Name: test-aoi1-month07 
ID: 1a7252c6-6037-40e8-a3ca-1e274607157a 
Status: failed 
Duration: 2m35.768276919s

and also states that the geometry is invalid. The geojson is below

{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": { "id": 0 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -0.831, 5.756599999999446 ], [ -0.7986, 5.756599999999446 ], [ -0.7986, 5.71 ], [ -0.831, 5.71 ], [ -0.831, 5.756599999999446 ] ] ] } }
]
}

test_aoi1_id.txt

The order also fails when I run the following command (no clipping). There's no error output so it's hard to diagnose

porder order --name test-aoi1-month07 --idlist ~/planet/cloud-free-planet/notebooks/test_aoi1_id.txt --item PSScene4Band --asset analytic_sr --boundary test_tile.geojson --aws ~/planet/cloud-free-planet/notebooks/aws.yaml --op aws clip email

I appreciate the help, let me know if there's any other info I can provide.

init deprecation warnings for each scene that is searched with porder search

Hi Sam!

This looks to be because of the form pyproj.Proj(init=epsgcode) that is used in geojson2id.py. I took a crack at solving this since the warnings were filling up a notebook I was running and also updated the code to use at least pyproj 2.2.2, which comes with > 10x speedup for the search function (according to my own test run.) I'm submitting a PR soon

The warnings:

Running search for a maximum of: 1000000 assets
/home/rave/miniconda3/envs/porder-test/lib/python3.8/site-packages/pyproj-2.4.2.post1-py3.8-linux-x86_64.egg/pyproj/crs.py:77: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method.
  return _prepare_from_string(" ".join(pjargs))
/home/rave/miniconda3/envs/porder-test/lib/python3.8/site-packages/pyproj-2.4.2.post1-py3.8-linux-x86_64.egg/pyproj/crs.py:77: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method.
  return _prepare_from_string(" ".join(pjargs))
/home/rave/miniconda3/envs/porder-test/lib/python3.8/site-packages/pyproj-2.4.2.post1-py3.8-linux-x86_64.egg/pyproj/crs.py:77: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method.
  return _prepare_from_string(" ".join(pjargs))
...

porder order --> Bad request

Hi Samapriya,
running a porder order returns "Failed with response: Bad request".

porder order --name "Peel" --idlist "C:\Users\initze\OneDrive\Paul\imlists\link_file_10.csv" --asset "analytic" --item "PSOrthoTile" --boundary "C:\Users\initze\OneDrive\Paul\peeltour.geojson " --op clip email

The image list was successfully created with porder idlist
After the above error I run a split, which resulted in the same error.

System:
Anaconda virtual environment, python 3.6.3
PL_API_KEY is set
porder quota works

Thanks for your help

multiproc without specifying extension

Would be better to allow multiprocessing download of all available image, metadata, RPC, etc files for each id, rather than requiring the user to limit to one extension type. Should be straightforward to implement.

support n string or range filters

This would be super useful for whittling down planet scenes that are in the "test" category, fall outside of sensor view angle limits, and are not of a particular instrument type (I'm looking to get all of one type, either PS2 or the new PS2). Filtering by these three categories requires 2 string filters and a range filter (plus I'd also like to filter by boolean, the positional_accuracy flag).

If I run porder idlist with two string filters I get more scenes returned than if I used 1 string filter, which makes me think the second string filter is causing the other string filters to not be ran (using two string filters should return less scenes than 1 string filter)

Running search for a maximum of: 1000000 assets
Total number of assets written to /home/rave/temporal_mixing/data/idlist_standard_and_test.csv ===> 2635
Running search for a maximum of: 1000000 assets
Total number of assets written to /home/rave/temporal_mixing/data/idlist_all_filters.csv ===> 2665

Python 3 incompatibility: CSV is parsed as a string but csv package expects bytes object

(v2-cloud)~/cloud-free-planet/notebooks$ porder idlist --input "/home/rave/cloud-free-planet/notebooks/test_tile_half.geojson" --start "2018-07-01" --end "2018-07-31" --item "PSScene4Band" --asset "analytic_sr" --number 10000 --outfile "/home/rave/cloud-free-planet/notebooks/test_half_ids.csv" --cmin 0 --cmax 1 --overlap 0
Traceback (most recent call last):
  File "/home/rave/anaconda3/bin/porder", line 11, in <module>
    sys.exit(main())
  File "/home/rave/anaconda3/lib/python3.6/site-packages/porder/porder.py", line 172, in main
    args.func(args)
  File "/home/rave/anaconda3/lib/python3.6/site-packages/porder/porder.py", line 55, in idlist_from_parser
    outfile=args.outfile)
  File "/home/rave/anaconda3/lib/python3.6/site-packages/porder/geojson2id.py", line 118, in idl
    writer.writeheader()
  File "/home/rave/anaconda3/lib/python3.6/csv.py", line 144, in writeheader
    self.writerow(header)
  File "/home/rave/anaconda3/lib/python3.6/csv.py", line 155, in writerow
    return self.writer.writerow(self._dict_to_list(rowdict))
TypeError: a bytes-like object is required, not 'str'

Looks like it is related to how python 2 and 3 handle reading and writing csvs: https://stackoverflow.com/questions/34283178/typeerror-a-bytes-like-object-is-required-not-str-in-python-and-csv

It might be a simple fix of changing all the write options from w to explicitly be wb so that Python 3 interprets args.outfile as bytes. Thoughts?

unexpected behavior of porder idlist - returning empty file

Hi,
I'm using porder idlist in code looping over mulitple locations to download imagery. While doing that, the command suddenly started returning empty lists, and evidently stopped searching through the Planet library. The same is now the case when entering the porder idlist command directly in the terminal, independent of the geography or time range I use. Other commands like porder quota work as expected. Any ideas?
Thanks a lot!

can't seem to get gcs delievery working

I get the following error with porder: "Unable to accept order: Your organisation is not permitted to deliver to Google Cloud Storage"

Is this an issue with the cert file I provide porder or an issue with my account with planet?

Error placing planet order

Hello Samapriya,

Thanks for your work on porder.
Unfortunately i have a problem by placing an order:
porder order --name "NOE_GAP_Clip" --idlist "C:\Users\MyName\planetGeo\orderlist.txt" --item "PSScene4Band" --asset "analytic" --boundary "C:\Users\MyName\planetGeo\ID5_NOE.geojson" --op clip zip email doesn't work.

The error message i get:
{"field":{"Products":[{"message":"Item ID or Item Type empty"}]},"general":[{"message":"Unable to accept order"}]}

Can you please help me, to solve this issue. I read somewhere in the planet forum, that there was an issue with the Clip functionality in an older version of porder. I use porder v0.1.9

Thanks in advance
Christian

EPSG Code to be accepted by user, this is not available in skysat json ?

Hi Samapriya,
The Skysat json does not contain the epsg code in it, I see that you use it to do the overlap calculation in m units. This can be overcomed in 2 ways, accept a epsg code from the user as an optional argument in idlist etc, or calculate a local equal area coordinate system from the input user geometry the tool takes in and then define everything with respect to that. These operations can be performed if the ['item']['properties']['epsg_code'] is None or something.
Thanks for putting up this tool.
Shashank

Issues with MultiPolygon AOI and Order Command

Hey there,

I'm doing orders with MultiPolygon AOI and ran into the following problem:

the JSON object must be str, bytes or bytearray, not dict
Bad Request ...

I think the issue is here and here.

The assumption is that aoi_resp is a string. But if you look and multipoly() it can only return a dict or list or other Python data structure. I removed the json.loads(....) functions and it works.

order didn't produce url, no error given

hi, i'm using this tool for the fist time.
It seems that everything is working ok.
i manage to get the idlist and to place an order (after a few trys) with :
porder order --name "tabare1" --idlist "D:\OneDrive\teleysig_javierMoreira\TrabajoFinal\Tesis\VALIDACION\CHACRAS\imagenes\split\tabare_init.csv" --item "PSScene4Band" --asset "analytic_sr" --boundary "D:\OneDrive\teleysig_javierMoreira\TrabajoFinal\Tesis\VALIDACION\CHACRAS\TABARE.geojson" --op clip zip email
my question:
i have no response, no by mail, neither in the cmd. I have tried first a fairly large number of images (50), spliting the idlist: but then, i have tried with 10 images, to check if that was the problem.
No response in either case.
how much is a reasonable time to wait? i should be an hour ago since my last try.

thanks!

Error converting to geojson from shapefile

Issue

I've used the porder convert command a few times, but in the last couple days I've started getting some error warnings about an invalid CRS input, and because of this the geojsons are not created.

My workflow:

  • initialize planet
  • take a coordinate, create a buffer of 500m around it and save as a shapefile polygon with projection CRS("+proj=utm +zone=46, +ellps=WGS84")
  • convert to geojson using porder convert

Result:

This has worked fine in the past several weeks, but yesterday for the first time I got this error (along with the future warning):

/Users/imcgreg/opt/anaconda3/envs/envDiss/lib/python3.7/site-packages/pyproj/crs/crs.py:53: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
  return _prepare_from_string(" ".join(pjargs))
Invalid input to create CRS: {'init': 'epsg:32646'}

Troubleshooting

As a base method, I tried updating conda in my environment and also updated gdal. The code then worked (albeit still giving me the FutureWarning)

/Users/imcgreg/opt/anaconda3/envs/envDiss/lib/python3.7/site-packages/pyproj/crs/crs.py:53: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
  return _prepare_from_string(" ".join(pjargs))
Export completed to /Volumes/SEAL/IanMcGregor/planetImages/geojsons/5m/g2p13_1.geojson

This morning I tried doing the same thing by creating the shapefiles again and converting to geojson. I ran into the same invalidCRS error. This time, though, all I did was open a new terminal and try again, and it worked. I'm confused about this behavior.

I'm curious what the reason is for this. Please let me know if you'd like the full source code I'm using for the shapefiles / sample coordinates. I'm also wondering if this is an issue with my conda environment specifically but I don't think so.

Missing files after download

Hello,

i used porder quite extensively. In some cases, i noticed a strange behaviour regarding the
download: it happened, that certain files from a scene are not downloaded, e.g. the udm file
is missing or the metadata file is missing. If i repeat the download, then the file is loaded.
Sometimes I had to repeat the download more often to get all the files from a scene.
I used "porder download" without arguments and the order was not that big, about 50 scenes.
Do you know something about this problem?

Regards

accessing analytic_8b_sr_udm2

This asset does not seem to be available for download through porder at the moment. Writing it in the 'bundle' option of 'porder order' returns an error ("Failed with response: Bad requestUnable to accept order"), and it is not listed when checking "porder bundles --item "PSOrthoTile"". Thanks for any help!

AOI clip error

porder order command with '--op clip' option gives error:
Unable to accept order: AOI is invalid: Self-intersection[-91.3017465704121 43.7893715726562]

Missing import progressbar in async_down.py

If you try to run porder multiproc it fails with:

Traceback (most recent call last):
  File "/home/ec2-user/.local/bin/porder", line 11, in <module>
    sys.exit(main())
  File "/home/ec2-user/.local/lib/python3.7/site-packages/porder/porder.py", line 359, in main
    args.func(args)
  File "/home/ec2-user/.local/lib/python3.7/site-packages/porder/porder.py", line 229, in multiproc_from_parser
    downloader(url=args.url,final=args.local,ext=args.ext)
  File "/home/ec2-user/.local/lib/python3.7/site-packages/porder/async_down.py", line 111, in downloader
    loop.run_until_complete(future)
  File "/usr/lib64/python3.7/asyncio/base_events.py", line 584, in run_until_complete
    return future.result()
  File "/home/ec2-user/.local/lib/python3.7/site-packages/porder/async_down.py", line 90, in get_data_asynchronous
    urllist=funct(url=url,final=final,ext=ext)
  File "/home/ec2-user/.local/lib/python3.7/site-packages/porder/async_down.py", line 66, in funct
    bar = progressbar.ProgressBar()
NameError: name 'progressbar' is not defined

Also, Pycharm marks sys in line 14 and time in line 68 as not imported.

order download link

Wouldn't it be nice if we can also get the order download link by passing the order name other than only getting it via the email?

UDM2 mask download

Hello Samapriya,

this is not an issue, but a question: i loaded quite a bit planetscope scenes in summer 2019 (4 band
analytic & analytic_sr product). At this time, i didn't think about the new udm2 mask. Last week, i took a look at these udm2 masks and they look quite promising. So, is it possible to order only the udm2 mask for a planet scene i already have, or is it necessary to order the complete scene (eg bundle type "analytic_sr_udm2") to get the udm2 tif?

Regards
Christian

idlist command not completeing, no error message

Hi,

I used porder a lot in May and it worked great, but now I'm coming back to it and having an issue. I tried running:
porder idlist --input "Y:/duncansongp/Planet/geojsons/amazondeg.geojson" --start "2014-01-01" --end "2019-09-04" --item "PSScene4Band" --asset "analytic" --cmax 0.1 --overlap 100 --outfile "Y:/duncansongp/Planet/orderids/amazondeg.csv"

This same code worked quickly/ easily when I ran it in May, but now I hit enter and it doesn't fail or give me any error messages, but it never completes.

I tried some old order and multipart download commands and those are working normally, it seems to just be idlist.

Any idea what could be going on here?
Thanks!
Kate

downloading PSScene4Band Analytic

Hello Sam, I have an education and research grant account, and have access to PSScene4Band in the GUI, and get PSScene4Band in the list of available assets using a curl planet api v1 command, but when using porder (and a list of about 20 items and a clip command):

{"field":null,"general":[{"message":"Order request resulted in no acceptable assets. Likely due to lack of permissions."}]}

I have run a test order using PSOrthoTile which returns successfully, which makes me think there may be an issue with accessing api v2 permissions and porder? Here is my porder command:

porder order --name "allee" --idlist "allee_list1.txt" --item "PSScene4Band" --asset "analytic" --boundary "allee.geojson" --op clip

Thanks for any help or advice.

A KeyError related to AWS delivery

We got an error days ago when trying to deliver the Planet images to our AWS S3. The error won't block our work but it is better to fix it. Here is the error:

I ran first to order the idlist, everything is fine so far, then use the command line below to get the download link:
porder order --name 'ghana_order' --idlist '~/spatial/data/orderlist/orderlist_ghana_group1.csv' --item 'PSScene4Band' --asset 'analytic_sr' --aws '~/common/aws_cred.yml' --op aws

Then I started the delivery by using:
porder download --url 'https://api.planet.com/compute/ops/orders/v2/********-****-****-****-********'
Even though the images were delivered successfully, but we keep getting this error. Didn't get a chance to look over the raw code yet, sorry I cannot be more specific. Hope you guys could find out what is going on.

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/bin/porder", line 10, in <module> sys.exit(main()) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/porder/porder.py", line 290, in main args.func(args) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/porder/porder.py", line 156, in download_from_parser ext=args.ext) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/porder/downloader.py", line 71, in download url=(items['location']) KeyError: 'location'

invalid syntax in pySmartDL.py

I copied the porder repo to my home directory to edit the line in order_now.py to aoi_resp = json.loads(aoi.read()) to fix an error in accordance with an issue fix suggested in a previous post. I ran the following code to install the porder package from that local source

conda create -n porder-env python=2.7.15
source activate porder-env
pip install shapely
python setup.py install

and this resulted in this final line of the error message

File "/var/folders/z2/q82ly6v96rj1snmtzthqqk740000gn/T/easy_install-xZ4yoj/pySmartDL-1.3.1/pySmartDL/pySmartDL.py", line 626
    print(status, end='', flush=True)
                                ^
SyntaxError: invalid syntax

Let me know if you need more of the error message to be helpful. Thanks for any help fixing this or suggested work arounds. I'm working on a Mac with OS 10.14.3

Suggestion: filter by acquisition time

Hi Samapriya,

I'd have a suggestion for an additional filter criterion for the idlist command, namely the time of day at which the image was acquired. Or is there perhaps a way to do this already?

Thanks a lot,

Tillmann

When downloading an order, manifest.json sometime overwrites contents of another file

Sometimes, one of the files in the order is overwritten with the contents of the manifest.json, while keeping its filename. I did some digging, and I think I understand why.

In the file porder/downloader.py, line 167, when the program encounters the file manifest.json, it fetches it, reads it, and for each file contained in the manifest, and attempts to create a local_path (it is not clear to me why, but that is fine). The problem is that when the code continues on line 184, the local_path variable is actually not the path of the manifest file, it is the path of the last file contained in the manifest (for example the udm2 file). [let's call it FILE] The program then attempts to download manifest.json, but save it as FILE.

Within a given order, the files (for example: analytic tiff, udm, udm2, metadata xml, metadata json and manifest json) seem to be in a random sequence.

  1. If manifest.json is after FILE in the sequence, it is fine, the program will print "File already exists SKIPPING" and doesn't download the manifest.

  2. If manifest.json is before FILE in the sequence, it downloads manifest.json, and saves it as FILE. When it then tries to download the real FILE, it is skipped with the message "File already exists SKIPPING"

I think that the fix is quite simple, remove the else statement on line 182, remove one indent from line 183. I could be wrong though, I did not test it.

Cheers,
Jan

Quota Estimation

Hey Sam!
I will be great to be able to get quota consumption estimation for any idlist.

`idlist` and `order` would fail if the multi-polygons are adjacent to each other (self-intersect)

I used a multi-polygon geojson to list the ids and order the imagery, then I realized that these two functions failed because the polygons are adjacent to each other (self-intersection happened). I queried imagery a few times before, I think I did everything following the instruction.

Here are my clues so far:

  1. For idlist, the problem happened in line 190 in file geojson2id.py, I added one line aoi_shape=aoi_shape.buffer(0) here then it works fine to query the ids. But I am not sure the result is correct or not since I failed to download the imagery.

  2. For order, it failed with a return 'Failed with response: Bad request'. The problem happened in object payload in line 266 in file order_now.py. It seems that the request doesn't follow the syntax of Planet API. I tried separated multi-polygons, it works just fine. So my guess: the problem here is still the adjacent polygons issue.

My queries are here:

porder idlist --input '/working_dir/supergrid2_test.geojson' --start '2018-01-01' --end '2018-01-10' --item 'PSScene4Band' --asset 'analytic_sr' --number 1000 --outfile '/working_dir/orderlist_supergrid2_test.csv'
porder order --name "supergrid2_4grids" --idlist "/working_dir/orderlist_supergrid2_test.csv" --item "PSScene4Band" --asset "analytic_sr" --boundary '/working_dir/supergrid2_test.geojson' --op clip

My geojson file is here:
supergrid2_test.geojson.zip

pyperclip doesn't work on systems without GUIs

Hey Sam, thanks for the great tool! I'm trying to use porder from an aws instance, since eventually I'd like to use porder and computationally demanding tools in a single process on a infrastructure that can scale up. When I use porder order like so

porder order --name test-aoi1-month07 --idlist ~/planet/cloud-free-planet/notebooks/test_aoi1_id.txt --item PSScene4Band --asset analytic_sr --boundary test_tile.geojson --aws ~/planet/cloud-free-planet/notebooks/aws.yaml --op aws

I get the following error, even though I've installed xsel and xclip. It sounds like it relates to this issue: https://stackoverflow.com/questions/51662213/cant-get-pyperclip-to-use-copy-and-paste-modules-on-python3

Traceback (most recent call last):
  File "/home/ubuntu/anaconda3/envs/porder_env/bin/porder", line 11, in <module>
    sys.exit(main())
  File "/home/ubuntu/anaconda3/envs/porder_env/lib/python2.7/site-packages/porder/porder.py", line 204, in main
    args.func(args)
  File "/home/ubuntu/anaconda3/envs/porder_env/lib/python2.7/site-packages/porder/porder.py", line 96, in order_from_parser
    gcs=args.gcs)
  File "/home/ubuntu/anaconda3/envs/porder_env/lib/python2.7/site-packages/porder/order_now.py", line 171, in order
    clipboard.copy(str(url) + '/' + str(content['id']))
  File "/home/ubuntu/anaconda3/envs/porder_env/lib/python2.7/site-packages/pyperclip/__init__.py", line 616, in lazy_load_stub_copy
    return copy(text)
  File "/home/ubuntu/anaconda3/envs/porder_env/lib/python2.7/site-packages/pyperclip/__init__.py", line 301, in __call__
    raise PyperclipException(EXCEPT_MSG)
pyperclip.PyperclipException: 
    Pyperclip could not find a copy/paste mechanism for your system.
    For more information, please visit https://pyperclip.readthedocs.io/en/latest/introduction.html#not-implemented-error 

This makes sense since the tool was developed for a personal machine environment. I can edit my own installation of porder to remove the use of clipboard, but thought I'd bring this up.

Python 3.X invalid syntax for print statement in multiproc_pydl.py line 99

Using Python 3.6.6
Received the following error when trying to use the multiproc tool:

  File "multiproc_pydl.py", line 99
    print msg, multiprocessing.current_process().name
            ^
SyntaxError: invalid syntax

Fixed it by simply adding a () around the print statement to follow Python 3.X print syntax.

print (msg, multiprocessing.current_process().name)

Other than that... love the porder CLI tool!!! Keep up the good work!

can't seem to switch subscriptions

I am attempting to use a different quota/subscription id using --sid, but I get the following error after submitting orders:

"Quota check failed - Insufficient quota: /subscriptions do not match all of the events"

AttributeError: 'Namespace' object has no attribute 'func' for python 3.6 or greater

Fresh installs of porder with python versions 3.6.7 or greater now bark when running porder

# rave at rave-thinkpad in ~/planet_tutorial [12:32:58]
โ†’ porder                          
Traceback (most recent call last):
  File "/home/rave/miniconda3/envs/py3/bin/porder", line 8, in <module>
    sys.exit(main())
  File "/home/rave/miniconda3/envs/py3/lib/python3.6/site-packages/porder/porder.py", line 450, in main
    args.func(args)
AttributeError: 'Namespace' object has no attribute 'func'
(py3) 

I tested this on a python 2.7 environment and the error does not occur. To reproduce the error:

conda create -n py3 python=3.6 
conda activate py3
pip install porder datetimerange
porder

I'm not sure why this fails, being unfamiliar with argparse, but maybe this SO post helps? https://stackoverflow.com/questions/16878315/what-is-the-right-way-to-treat-python-argparse-namespace-as-a-dictionary

invalid geometry and unable to submit order with valid idlist

Hi Sam, reopening this after trying to order while clipping again

When I run this

(v2-cloud)~/cloud-free-planet/notebooks$ porder order --name test-tile_fourth --idlist ~/cloud-free-planet/notebooks/test_fourth_ids.txt --item PSScene4Band --asset analytic_sr --boundary test_tile_fourth.geojson --op clip email
Could not parse geometry
{"field":null,"general":[{"message":"Unable to accept order: geojson: invalid geometry"}]}

There's no order url that is printed so I can't check the error message as you suggested. I tried to run without clipping:

(v2-cloud)~/cloud-free-planet/notebooks$ porder order --name test-tile_fourth --idlist ~/cloud-free-planet/notebooks/test_fourth_ids.txt --item PSScene4Band --asset analytic_sr --boundary test_tile_fourth.geojson
Order created at https://api.planet.com/compute/ops/orders/v2/268eb482-0622-4373-aaf6-4f75fea64c61 and url copied to clipboard

But I get this error when I check the url

{
"_links": {
"_self": "https://api.planet.com/compute/ops/orders/v2/268eb482-0622-4373-aaf6-4f75fea64c61"
},
"created_on": "2019-02-19T22:19:26.462Z",
"error_hints": [
"There are no result bands produced, operation fails. (code: FAILURE_CODE_INVALID_INPUT Bandmath_v1)",
"There are no result bands produced, operation fails. (code: FAILURE_CODE_INVALID_INPUT Bandmath_v1)",
"There are no result bands produced, operation fails. (code: FAILURE_CODE_INVALID_INPUT Bandmath_v1)",
"There are no result bands produced, operation fails. (code: FAILURE_CODE_INVALID_INPUT Bandmath_v1)",
"There are no result bands produced, operation fails. (code: FAILURE_CODE_INVALID_INPUT Bandmath_v1)",
"There are no result bands produced, operation fails. (code: FAILURE_CODE_INVALID_INPUT Bandmath_v1)"
],
"id": "268eb482-0622-4373-aaf6-4f75fea64c61",
"last_message": "Order resulted in 0 assets",
"last_modified": "2019-02-19T22:20:23.603Z",
"name": "test-tile_fourth",
"order_type": "partial",
"products": [
{
"item_ids": [
"20180703_095732_1015",
"20180610_095739_1008",
"20180606_104025_0f3c",
"20180602_095704_1018",
"20180602_104029_1053",
"20180601_104054_0f46"
],
"item_type": "PSScene4Band",
"product_bundle": "analytic_sr"
}
],
"state": "failed",
"tools": [
{
"bandmath": {}
}
]
}

I thought this might be because I included the --boundary option without specifying --op clip (not sure if these are dependent on each other. But when I run this without the boundary option or clipping

(v2-cloud)~/cloud-free-planet/notebooks$ porder order --name test-tile_fourth --idlist ~/cloud-free-planet/notebooks/test_fourth_ids.txt --item PSScene4Band --asset analytic_sr
Order created at https://api.planet.com/compute/ops/orders/v2/672a85c9-585e-4c65-af4c-6f2767eddbcb and url copied to clipboard

I get the same error as above

{
"_links": {
"_self": "https://api.planet.com/compute/ops/orders/v2/672a85c9-585e-4c65-af4c-6f2767eddbcb"
},
"created_on": "2019-02-19T22:20:55.481Z",
"error_hints": [
"There are no result bands produced, operation fails. (code: FAILURE_CODE_INVALID_INPUT Bandmath_v1)",
"There are no result bands produced, operation fails. (code: FAILURE_CODE_INVALID_INPUT Bandmath_v1)",
"There are no result bands produced, operation fails. (code: FAILURE_CODE_INVALID_INPUT Bandmath_v1)",
"There are no result bands produced, operation fails. (code: FAILURE_CODE_INVALID_INPUT Bandmath_v1)",
"There are no result bands produced, operation fails. (code: FAILURE_CODE_INVALID_INPUT Bandmath_v1)",
"There are no result bands produced, operation fails. (code: FAILURE_CODE_INVALID_INPUT Bandmath_v1)"
],
"id": "672a85c9-585e-4c65-af4c-6f2767eddbcb",
"last_message": "Waiting for per-bundle operations to complete. Running 0, Succeeded 0, Failed: 6",
"last_modified": "2019-02-19T22:21:47.901Z",
"name": "test-tile_fourth",
"order_type": "partial",
"products": [
{
"item_ids": [
"20180703_095732_1015",
"20180610_095739_1008",
"20180606_104025_0f3c",
"20180602_095704_1018",
"20180602_104029_1053",
"20180601_(v2-cloud)~/cloud-free-planet/notebooks$ porder order --name test-tile_fourth --idlist ~/cloud-free-planet/notebooks/test_fourth_ids.txt --item PSScene4Band --asset analytic_sr
Order created at https://api.planet.com/compute/ops/orders/v2/672a85c9-585e-4c65-af4c-6f2767eddbcb and url copied to clipboard
104054_0f46"
],
"item_type": "PSScene4Band",
"product_bundle": "analytic_sr"
}
],
"state": "running",
"tools": [
{
"bandmath": {}
}
]
}

Here is my geojson

{
"type": "FeatureCollection",
"name": "test_tile_fourth",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "id": 0 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -0.831053947078279, 5.733240915104465 ], [ -0.815377541344895, 5.733079073869626 ], [ -0.815323594266615, 5.709838158765161 ], [ -0.831, 5.71 ], [ -0.831053947078279, 5.733240915104465 ] ] ] } }
]
}

I'm not sure what to make of the error, especially since the idlist was created successfully. Here's what I used to create the idlist

(v2-cloud)~/cloud-free-planet/notebooks$ porder idlist --input "/home/rave/cloud-free-planet/notebooks/test_tile_fourth.geojson" --start "2018-06-01" --end "2018-08-31" --item "PSScene4Band" --asset "analytic_sr" --number 10000 --outfile "/home/rave/cloud-free-planet/notebooks/test_fourth_ids.csv" --cmin 0 --cmax .5 --overlap 100

Any help or suggestions are appreciated, thank you! Let me know if I can provide more info.

Originally posted by @rbavery in #5 (comment)

"page" variable from api request has no "links" key

I'm using the most recent version of porder in a python 2 environment and get the following when making an order

(porder-env) (v2-cloud)~/cloud-free-planet/notebooks$ porder idlist --input "/home/rave/cloud-free-planet/notebooks/test_tile_half.geojson" --start "2018-07-01" --end "2018-07-31" --item "PSScene4Band" --asset "analytic_sr" --number 10000 --outfile "/home/rave/cloud-free-planet/notebooks/test_half_ids.csv" --cmin 0 --cmax 1 --overlap 50
'features'
Traceback (most recent call last):
  File "/home/rave/anaconda3/envs/porder-env/bin/porder", line 11, in <module>
    load_entry_point('porder==0.1.7', 'console_scripts', 'porder')()
  File "/home/rave/anaconda3/envs/porder-env/lib/python2.7/site-packages/porder/porder.py", line 213, in main
    args.func(args)
  File "/home/rave/anaconda3/envs/porder-env/lib/python2.7/site-packages/porder/porder.py", line 71, in idlist_from_parser
    outfile=args.outfile)
  File "/home/rave/anaconda3/envs/porder-env/lib/python2.7/site-packages/porder/geojson2id.py", line 180, in idl
    while page['_links'].get('_next') is not None:
KeyError: '_links'

I've confirmed with porder quota that my credentials are initialized properly. Not sure what the issue is here but I can try to debug further and update.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.