I have a shapefile with no spatial reference nor projection, and a GEOTIFF that has the spatial reference and projection data. The shapefile was created from a segmentation analysis of the GEOTIFF, therefore the extent of the shapefile matches that of the GEOTIFF, and should be overlayed on the GEOTIFF. The two files can be found here.
I have tried the raster, sp and RGDAL packages, among others, to try to project/reproject the shapefile. Due to the size of the shapefile, it takes over 2 days to rasterize from the raster package. I have tried to convert a smaller shapefile (samp.shp) to a raster, then copy the projection of the GEOTIFF (geotiff) to the new sampled raster.
samp.shp.raster<-raster(samp.shp,res=r)
shp.rasPRO = projectRaster(samp.shp.raster, geotiff)
This seems to work on the sample, but I cannot get to reproduce it for my data. I think if I can convert the shapefile to a grid, then I can copy the X,Y coordinates of the geotiff to that grid, but I am not sure if this would work. I have >200 individual GEOTIFFs and corresponding shapefiles and I need to batch process. I am searching for the most efficient method of assigning the spatial reference and projection data to the shapefiles.
Any suggestions would be welcomed.
x' = 50000 + x*0.25andy' = 1529000 + y*-0.25. I am thinking that it should give the same respective offset values. But dont know if this helps – user2507608 Jul 14 '17 at 05:41