I am georeferencing a number of images using R. I can read the image in fine, and set an extent:
library(raster)
library(rgdal)
library(maptools)
## Read in the image as a raster
my.raster <- raster("MyImage.tif")
## Read in previously gecoded maps
my.polygons<-readOGR("Poly.shp")
## Fix the extent
extent(my.raster)<-extent(my.polygons)
projection(my.raster) <- "+proj=longlat +datum=WGS84 +no_defs
+ellps=WGS84 +towgs84=0,0,0"
But when I look at the file I see that the x and y resolutions are off:
class : RasterLayer
band : 1 (of 3 bands)
dimensions : 1935, 2511, 4858785 (nrow, ncol, ncell)
resolution : 0.0006940597, 0.0003798972 (x, y)
extent : -91.81082, -90.06803, 13.84329, 14.57839 (xmin, xmax, ymin,
ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84
+towgs84=0,0,0
and then when I start manually changing the extent to match the shapefile I have, it only gets worse. If I resample(from the raster package), it gets worse again.
Can I georeference an image and keep the resolutions consistent so that when I export it to ArcGIS or whatever, it is properly placed?
I am not providing files, because the project has confidentiality issues.