Skip to main content

We are unable to create an order for a specific polygon for quite sometime, but earlier successful orders were created for the same polygon. Have been getting the response with error code 400 and message.


“error”: {

“status”: 400,

“reason”: “Bad Request”,

“message”: “Invalid request”,

“code”: “COMMON_BAD_PAYLOAD”,

“violation”: “Geometry must not have more than 100 points.”


The above error was not used to get before even with more than 100 geometry points. Please advise on this.


Thanks

Hi,

The API currently takes geometries having less than 100 points. We recommend simplifying your geometries a bit in this case.


 

The above error was not used to get before even with more than 100 geometry points. Please advise on this.

I believe this rule is there for quite a while.


We have placed a successful order with 185 geometrical points on 26-Aug-2021. Please find the below order Dashboard. Could you recheck why we are unable to place orders for the same polygon? is this is really because of geometry points or something else?


This change was introduced on September 6th due to the inconsistencies that were happenning with imported data on some occassions. We wanted to prevent the quality of data to degrade in the process. Sorry if this caused some inconvenience to you.


I am therefore pretty confident that it is only because of number of points and if you perform simplify geometry you should get the same data.

(note that this will also not consume additional quota on PlanetScope)


I simplified the geometry to this one:


{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[30.549852873,-17.13357138],[30.549727434,-17.13262249],[30.549358998,-17.131733218],[30.548770715,-17.130959441],[30.548405201,-17.130631428],[30.547560158,-17.130118939],[30.547093956,-17.129942545],[30.546110838,-17.129763324],[30.545246010706407,-17.12980719738216],[30.545731387,-17.129665074],[30.546278558,-17.129367739],[30.546793542,-17.128957622],[30.547083221,-17.128547503],[30.547104678,-17.128424468],[30.546900831,-17.12815789],[30.546192727,-17.127778529],[30.546181999,-17.127696504],[30.546364389,-17.127675998],[30.546450219,-17.127727264],[30.547008119,-17.127758023],[30.547158323,-17.127727264],[30.547426544,-17.127819541],[30.547501645,-17.127758023],[30.547576747,-17.127542709],[30.547684036,-17.126948032],[30.547598205,-17.126220064],[30.547083221,-17.124661586],[30.546847186,-17.124251458],[30.546096168,-17.123697784],[30.545312963,-17.123287653],[30.54422935,-17.123113348],[30.54349979,-17.123195374],[30.542909704,-17.123400439],[30.542147956,-17.124128419],[30.541354022,-17.124374496],[30.541064344,-17.124753864],[30.540753207,-17.125369054],[30.540570817,-17.12607652],[30.540538631,-17.126722465],[30.540613733,-17.127255624],[30.540710292,-17.127645239],[30.54091414,-17.128116878],[30.541386209,-17.12881408],[30.541643701,-17.129101163],[30.542158685,-17.129521533],[30.543381772,-17.129952155],[30.544132791,-17.130023926],[30.54447707342078,-17.129999009339585],[30.543720713,-17.13034978],[30.542949548,-17.130959441],[30.542361265,-17.131733218],[30.541992829,-17.13262249],[30.54186739,-17.13357138],[30.541992829,-17.134520265],[30.542361265,-17.135409524],[30.542949548,-17.136183283],[30.543315062,-17.136511286],[30.544160105,-17.137023757],[30.544626306,-17.137200145],[30.545609425,-17.137379358],[30.546608297,-17.137319305],[30.547093956,-17.137200145],[30.547999549,-17.136792924],[30.548741940673093,-17.13620910435171],[30.548637846,-17.136707421],[30.548637846,-17.137653166],[30.548730754,-17.138118579],[30.549095081,-17.138997903],[30.549360755,-17.139397947],[30.55003824,-17.140087355],[30.550439368,-17.140365848],[30.551334861,-17.140768519],[30.552307015,-17.14094573],[30.553294746,-17.140886347],[30.554235992,-17.140594102],[30.55507161,-17.140087355],[30.555433048,-17.139763017],[30.556014769,-17.138997903],[30.556379096,-17.138118579],[30.556472004,-17.137653166],[30.556472004,-17.136707421],[30.556379096,-17.136242005],[30.556014769,-17.135362668],[30.555749095,-17.134962615],[30.555433048,-17.134597535],[30.554670483,-17.133994686],[30.55377499,-17.133592],[30.552802835,-17.133414782],[30.552307015,-17.133414782],[30.551334861,-17.133592],[30.550439368,-17.133994686],[30.54971185707794,-17.134566078010064],[30.549821389,-17.134049594],[30.549852873,-17.13357138]]]}}]}

and tried to prepare the order and it works fine. See order a543578c-0ccc-481b-MASKED in your account. It is not yet confirmed.


Hi,

Thank you.

Then we have to modify the code logic to simplify the polygon geometrical points. are there any suggestions for how simplifying the geometry points without affecting the area of interest?

Thanks
 


Hi,

not sure what you mean by “without affecting the area of interest”. If you are referring to Hectares under management business model, you should not worry at all. In this case, the “total managed area” is calculated by using UNION of all the geometries. Therefore, if your geometry will be almost the same, UNION will as well be practically the same, with one or two geometries.

In terms of actual simplification this thread might help:

gis.stackexchange.com Mike Furlender

GeoJSON too bulky

shapefile, leaflet, geojson, tiles

 


Thank you. we are using some JS library(turf) to union the polygons but that doesn’t seems to be simplifying. Now, we may have to modify the library across the project to support the latest changes introduced by sentinel hub.


Hey,

did you also try with Turf’s simplify?


I guess it might still not be enough, but maybe it will help.


Cheers.


Hi

Thank you for the suggestion. It seems its gonna work. Will let you know the results.

Regards
 


Hi,

We have simplified the coordinates but still some polygons facing some issues even though they are simplified to below 100 geometrical points. Now are getting the error “violation”: “Self-intersection”. Please find last successful order that was created for the polygon on 02-Aug-2021 Dashboard.

Regards
 


Hi,
self-intersection means that the geometry you are providing is not a valid one. It might be that in the past some of these have slipped through our checks and even that in some cases these worked fine. That said, invalid geometries will sooner or later cause problems, so it is best to prevent them at the source. We therefore fixed the checks and enforce only valid geometries to come through.
We are confident this is best for our users as well.
Sorry if this is causign inconvenience at the moment.

Best,
 


Hi,

Thanks for the prompt response.

I understand these issues have been occurring since the sentinel API has introduced new changes. Earlier we used to send the geometries with more than 100 geometry points and didn’t have any self-intersections. During the simplification of polygon geometry points, self-intersection might occur for some polygons. Again, we had to write additional logic to resolve this problem before sending the new appropriate geometry to the sentinel. However, we never know what new issues might face in the future with the latest changes introduced by sentinel. I wish sentinel API’s should have rolled out API versions instead of replacing the existing ones with new changes that literally cause the business operations inclusive of time and effort. Also it would have been nice to inform the customers with new changes as soon as they take place. Thanks for all the support though.

Regards
 


Hi,
your points are noted and well understood.
We generally do put a lot of effort to ensure that API changes are backward compatible (it cannot be done every time, I believe there were two breaking changes in the last two years, both impacting only small part of our users) and to inform about changes (typically in News thread, but often also via our mailing list and in some cases directly to users).
Sometimes, however, the (quick) changes are essential to ensure the stability and performance of our system (which, I am sure is something you exepect when using the APIs). In these cases we don’t have any other option than to push our users to change along. You have unfortunately stumbled upon such one, introduced almost half a year ago. Sorry about that.
And you are right, even these small bug-fixes should be promptly communicated.

Best,
 


Reply