Pixels run NS, EW. So the image is straight. Whats probably happening in you last screenshot is the black surround is black, rather than nodata or it's missing a transparency mask
Pixels run NS, EW. So the image is straight. Whats probably happening in you last screenshot is the black surround is black, rather than nodata or it's missing a transparency mask
Making it nodata results in this:
I want FME to write the resampled image into a straight image. For example, opening the original large geotiff in windows photo viewer shows the image as I want the final result, a rectangle with 90 degree corners:
@leif Within the RasterPropertyExtractor, it contains a value for the "rotation_x" attribute. This is the current rotation value of your Raster. You can first use an AttributeCreator to create a new attribute called "Rotate_by" and set the value to:
@Evaluate(-@Value(_rotation_x))
By turning the rotation value negative, we can now undo the rotation.
Next, add a Rotator transformer, connect it to the AttributeCreator, and set the Rotation Angle parameter to the attribute you just created. When you run the workspace, this should undo the rotation to the Raster. I've attached a sample workspace to demonstrate this.
@leif Within the RasterPropertyExtractor, it contains a value for the "rotation_x" attribute. This is the current rotation value of your Raster. You can first use an AttributeCreator to create a new attribute called "Rotate_by" and set the value to:
@Evaluate(-@Value(_rotation_x))
By turning the rotation value negative, we can now undo the rotation.
Next, add a Rotator transformer, connect it to the AttributeCreator, and set the Rotation Angle parameter to the attribute you just created. When you run the workspace, this should undo the rotation to the Raster. I've attached a sample workspace to demonstrate this.
Hi @danminneyatsaf,
I have tried using your approach, but I get the same result. I could set nodata to hide the black, but keep it to show that the image is not rotated straight.
Here is the large 441 MB raster in question if anyone want to give it a try:
Raster
Hi @danminneyatsaf,
I have tried using your approach, but I get the same result. I could set nodata to hide the black, but keep it to show that the image is not rotated straight.
Here is the large 441 MB raster in question if anyone want to give it a try:
Raster
@leif if you want to skew the raster so that it fits the shape of a rectangle (square corners), then you can use a combination of the BoundsExtractor to extract the square bounding box of the raster, and then use the RasterGeoreferencer to align the raster to the rectangular bounding box.
One thing to keep in mind is that this may affect accuracy of the raster, but if the desired product is just for visual purposes then this should work fine!
I've attached the sample workspace to this comment.
Hi @danminneyatsaf,
I have tried using your approach, but I get the same result. I could set nodata to hide the black, but keep it to show that the image is not rotated straight.
Here is the large 441 MB raster in question if anyone want to give it a try:
Raster
Precisely what I was trying to achieve. Thank you!