tyson-swetnam / porder

Simple CLI for Planet ordersV2 API
https://tyson-swetnam.github.io/porder/
Apache License 2.0
48 stars 12 forks source link

invalid geometry and unable to submit order with valid idlist #10

Closed rbavery closed 5 years ago

rbavery commented 5 years ago

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 https://github.com/samapriya/porder/issues/5#issuecomment-465336949

samapriya commented 5 years ago

Hey @rbavery thanks for pointing this out, I added bandmath function yesterday and that added an empty json to the payload. I have now made it conditional so that it does not add if there is no bandmath operation. If you do upgrade to porder 0.1.8 which I released like a minute ago, it should take care of the issue.

samapriya commented 5 years ago

And also @rbavery you are right --boundary and --op clip have to be used together

rbavery commented 5 years ago

Thanks a bunch!

On Tue, Feb 19, 2019, 3:07 PM Samapriya Roy <notifications@github.com wrote:

And also @rbavery https://github.com/rbavery you are right --boundary and --op clip have to be used together

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/samapriya/porder/issues/10#issuecomment-465349197, or mute the thread https://github.com/notifications/unsubscribe-auth/AVOkCX7KhytjbDxR8cnNemt5XuAGVF5tks5vPIPGgaJpZM4bEAHU .