I'm trying to georeference raster images to open them in ArcGIS Pro and make annotations.
I've used the Oriented Imagery toolset in ArcGIS Pro to get the footprint of each image based on camera specificities, altitude and orientation.
I exported the footprints polygons and I'm using them to extract the extent of each image in R and use it to georeference each raster image (open the image, assign the polygon boundaries to its extent, then saving as geotiff)
However, when I open the georeferenced raster, in R like in ArcGIS Pro, it doesn't align with the footprint, despite having the exact same extent:
plot(IMG)
plot(footprints[1], add=T, border="red")
ext(IMG) #extent of the raster
SpatExtent : 462774.903294892, 462961.507775558, 5846825.54872092, 5847043.96915049 (xmin, xmax, ymin, ymax)
extents[[1]] #extent of the footprint
SpatExtent : 462774.903294892, 462961.507775558, 5846825.54872092, 5847043.96915049 (xmin, xmax, ymin, ymax)
Any idea what's happening here ?
I need the raster to display properly to measure and annotate features on it. I know the dimensions of the footprint polygon are correct.
terra
doesn't do that. What's the coordinate system metadata of the IMG? Thestars
package might be able to handle it but you need to know the details of the rotation so it can compute the X,Y of each pixel instead of assuming an axis-aligned grid.