tgerdin
tgerdin

Reputation: 1

Static image positioned far north gets stretched

In our application we have a backend that does some raster processing on a region of a map and sends back an image to the OL-based frontend which inserts the image at the specified extent.

The polygon to process is sent as GeoJSON-coords (EPSG:4326) to the backend which then transforms the polygon to a rectangular projection (EPSG:3035 in this case), does the processing and sends the heatmapped results back to the frontend as a PNG-encoded image, reprojected server-side to EPSG:3857 (to match the projection of our OSM-based background map). The image is then inserted in an ImageLayer using an ImageStatic object, whose extent is computed by the backend (the EPSG:3035-transformed bounding box of the image transformed to EPSG:3857).

This works fine, except for polygons in the far north of Scandinavia. For instance, the image whose extent in EPSG:3857 is [1684632.9133543067,9544855.787615912,2902401.684702249,10831736.048522325] is visualized the following way when added to the map:

Erroneously projected image

The desirable result is for the image to follow the south-eastern boundaries of the shadowed polygon. Instead it is skewed and stretched out to the north-east.

I would be very grateful for any ideas and pointers as to why this is not working as expected.

Upvotes: 0

Views: 235

Answers (1)

tgerdin
tgerdin

Reputation: 1

I solved this by cropping the image to be reprojected as much as possible. The resulting envelope is then much smaller which did away with the distortions. Thanks for hint @Ian!

Upvotes: 0

Related Questions