1

I have many unreferenced raster tiles that I am trying to procedurally georectify. For each tile I know the exact extent co-ordinates (xmin, xmax, ymin, ymax) in my target CRS.

How can I transform these rasters, translating their arbitrary pixel-based co-ordinates (e.g 0,0 | 0,1280 | etc.) to match those calculated from my extent values?

All the GRASS tools seem to want manually generated GCPs and I'm unsure which GDAL tools would be suitable, given the raster tiles are unprojected.

I am looking for python / command line solutions on OSX.

  • am experimenting with .wld files which looks hopeful – Beeman May 21 '18 at 13:27
  • World files are good if you only need to scale and perhaps rotate your image. If your tiles are rectangular and not even rotated all you need is to use gdal_translate with the -a_ullr ulx uly lrx lry option. – user30184 May 21 '18 at 13:36
2

You can store the ground control points into your raw image with gdal_translate http://www.gdal.org/gdal_translate.html and if you want to warp the image into a north-up version you can do that with gdalwarp http://www.gdal.org/gdalwarp.html.

Usage:

gdal_translate -of VRT-gcp x y easting northing -gcp x y easting northing -gpc x y easting northing -gcp x y easting northing input.tif referenced_with_ground_control_points.vrt

The VRT file is a small xml file and you can open it now with QGIS and your image will appear georeferenced. But if you want to warp it physically materialize the VRT into a Geotiff. If the CRS of your ground control points were in EPSG:4326 the command would look like

gdalwarp -of GTiff -co tiled=yes -s_srs epsg:4326 -t_srs epsg:4326 referenced_with_ground_control_points.vrt warped.tif

There are many options in gdalwarp so read the manual page and make some tests with your own data.

It is also possible to do the same with GDAL and Python.

1

Besides the gdal_translate / VRT approach you can also use r.region to set the boundary definitions for a raster map.

You can assign to each unreferenced raster tile the N, S, W, E boundaries. See the manual page for an example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.