TransWikia.com

OpenLayers 5 - ImageStatic deformation

Geographic Information Systems Asked by Carrm on July 10, 2021

I’m having a hard time displaying a PNG correctly through ImageStatic. Here is what I have right now:

OL ImageStatic deformation

  • the outer feature is the extent of the PNG (the original image has margin around the colored content)
  • the inner feature is the expected display of the PNG

The PNG fits exactly with the inner feature, but OpenLayers seems to deform the image.

The PNG content was generated with EPSG:4326. The OL view was in EPSG:3857, I changed it to EPSG:4326, but with both EPSGs I can’t make the PNG fit the inner feature.

I’m using ngx-openlayers, with this configuration:

<aol-view #view [minZoom]="3" [zoom]="6" [maxZoom]="18" [center]="center" [projection]="proj4326"></aol-view>

<aol-layer-image [zIndex]="1">
    <aol-source-imagestatic
      [url]="imageLink"
      [imageExtent]="imageExtent"
      [projection]="proj4326"
    ></aol-source-imagestatic>
</aol-layer-image>

I also tried to use image reprojection (based on OL example), using EPSG:3857 for the view and EPSG:4326 for the ImageStatic. The result was similar to the one I showed above.

How can I make OpenLayers keep the original display of my PNG, without transformation?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP