Long URL problem when requesting imagery

One of the problems we run into at times when we fetch imagery is for the GET URL to get too long (pardon the pun:).

One of the reasons why we run into this problem is because we don’t support multiple fields on our platform at the moment. So the way we hack the system is to connect all the fields with thin lines which is then exported to the right coordinate format to use in the fetch. This, of course, causes the polygon to get unnecessarily long.

Apart from reducing the decimal places of the coordinates and ensuring the simplest possible polygon, there isn’t much I can do to stop this problem from happening.

However, if I can overcome the hack, that would be great.

Would it be possible to somehow use multiple polygons in another way? I was thinking of using something like http://geojson.io/, import multiple fields and then export the coordinates as a WKT or something.

Would this or something similar work?

Thanks,
Steyn

In this case I think the problem is not in the long URLs but rather in invalid geometry.
I suggest you use JSTS or some other topology cleanup library.

You might also try multi-polygon actually… We did not optimize our service for this case so it is not thoroughly tested, but we checked a few examples and it works. E.g. this one.
https://services.sentinel-hub.com/ogc/wms/<INSTANCE_ID>?service=WMS&request=GetMap&layers=1_NATURAL_COL0R&height=512&width=512&CRS=CRS:84&GEOMETRY=MULTIPOLYGON(((30 20, 45 40, 10 40, 30 20)),((15 5, 40 10, 10 20, 5 10, 15 5)))

Thanks Grega, I’ll try both of your suggestions.