0

I have tried

  • i am using affine transformation above lib and returns scaling, rotation and center of image transformation..
  • its giving the values
scaling : 327.805670381418,327.805670381418
rotation : -0.1310210334156003
transformation : 7179251.8557908312,6022627.228704552

// center of image from affine
const translationX = transformation.getTranslation()[0];
const translationY = transformation.getTranslation()[1];
extent = transformExtent([translationX - (xScale * this.imageData.width / 2),
        translationY - (yScale * this.imageData.height / 2),
        translationX + (xScale * this.imageData.width / 2),
        translationY + (yScale * this.imageData.height / 2)],
        get('EPSG:3857'), get('EPSG:4326'));
const imageProjection = this.returnRotateProjection(
        viewProjection,
        fromLonLat([transformation.getTranslation()[0], transformation.getTranslation()[1]], 'EPSG:4326'),
        transformation.getRotation(),
        extent
      );
const imgSource = new Static({
        url: this.imgURL,
        projection: imageProjection,
        imageExtent: extent,
        imageSize: [this.imageData.width, this.imageData.height],
        imageLoadFunction : (image) => {
          image.getImage().src = this.imgURL;
          if (image.resolution === undefined) {
            image.resolution = (image.extent[3] - image.extent[1]) / image.image_.height;
          }
          image.state = 2; // ImageState.LOADED;
          image.unlistenImage_();
          image.changed();
        }
      });
  • here issue is image resolution is very bad like image displaying like curve shape
  • is there any possibles for finding 4 corners(bounding box using center of image and rotated image center point and width, height, scalling)
  • suggest or help on this.. thanks in advance.. and save my days.. gis
  • The image is curved even before rotation as the image is reprojected from EPSG:27700 to EPSG:3857 https://openlayers.org/en/latest/examples/reprojection-image.html Do you need to rotate an image in its native projection? – Mike Nov 06 '21 at 15:43
  • @Mike, maybe.... **https://stackoverflow.com/questions/69088355/is-there-possible-for-set-rotation-and-scale-to-raster-static-image-source-in-op#** in this all scenarios working fine.. if i uploaded some rotation gis image then its rendering some thing wrong, meaning some some little bit curved image in main map.. – developer g Nov 06 '21 at 16:26
  • View and rotated image in EPSG:27700 with the baselayer reprojected https://codesandbox.io/s/reprojection-image-forked-unt7q – Mike Nov 06 '21 at 16:56
  • @Mike please how todo calculate 4 edges of images extends (bounding box)..using center of image from affine – developer g Nov 06 '21 at 17:14
  • Do you want the bounding box the image occupies in the view projection after rotation? https://codesandbox.io/s/reprojection-image-forked-unt7q – Mike Nov 06 '21 at 18:15

0 Answers0