1

I am attempting to use gdal_translate and gdal_warp to georeference an image similar to the plugin for QGIS "Georeferencer". When I use QGIS, georeferencer produces this GDAL script:

gdal_translate -of GTiff -gcp 1.47803e+06 -5.10486e+06 1.47803e+06 5.10486e+06 -gcp 1.47862e+06 -5.10514e+06 1.47862e+06 5.10515e+06...................

gdalwarp -r near -order 1 -co COMPRESS=NONE  ...........

What are the 'pixel' and 'line' (the first two variables after -gcp )?

I had assumed they were the x and y coordinates of the pixel to place the GCP, but my tiff isn't 1.5e+6 pixels wide, and I dont understand why the line would have a negative value.

here is the gdalinfo response for the tiff I am trying to georeference:

Driver: GTiff/GeoTIFF
Files:     C:\Users\PC_2\Downloads\uav_processing_pipeline\testing_z_field\mosaics%2F2018-    11-02_with_laz%2F8-fid12-park_rd_rcd30_2018-11-02_green_nogcp.tif
Size is 19206, 16391
Coordinate System is:
PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
GEOGCS["NZGD2000",
    DATUM["New_Zealand_Geodetic_Datum_2000",
        SPHEROID["GRS 1980",6378137,298.257222101,
            AUTHORITY["EPSG","7019"]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG","6167"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4167"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",173],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",1600000],
PARAMETER["false_northing",10000000],
UNIT["metre",1,
    AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","2193"]]
Origin = (1477791.815500000000000,5105524.866330000600000)
Pixel Size = (0.074660000000000,-0.074660000000000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_SOFTWARE=pix4dmapper
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( 1477791.816, 5105524.866) (171d28'14.69"E, 44d11'35.73"S)
Lower Left  ( 1477791.816, 5104301.114) (171d28'13.67"E, 44d12'15.38"S)
Upper Right ( 1479225.735, 5105524.866) (171d29'19.27"E, 44d11'36.59"S)
Lower Right ( 1479225.735, 5104301.114) (171d29'18.25"E, 44d12'16.24"S)
Center      ( 1478508.775, 5104912.990) (171d28'46.47"E, 44d11'55.99"S)
Band 1 Block=19206x1 Type=Float32, ColorInterp=Gray
  NoData Value=-10000
  • This might happen if the Geotiff is already georeferenced. Can you run gdalinfo on it to show the extent? – AndreJ Nov 14 '18 at 19:38
  • @AndreJ I have edited my original post to include the extent – jay Nov 14 '18 at 20:04
  • The leftmost column of an image has pixel=1 and number grows from left to right. Similarly the topmost row is row=1 and number grown from top to bottom. I don't understand how you get such GCP's from QGIS either. And your image seems to be already georeferenced, what's wrong with it? – user30184 Nov 14 '18 at 20:26
  • @user30184 sorry, let me clarify: on the gdal_translate page description has the formatting for -gcp as pixel line easting northing [elevation]. I am trying to georeference the image (as described with gdalinfo above) with the command line : gdal_translate -of GTiff -gcp 3193.0 8916.5 1478025.2557971247 5104862.229996126 -gcp 11155.5 5085.5 1478619.558916917 5105148.636674182 ..... and this works, but not as accurate as I would like. when I use the geoeferencer plugin on qgis and manually georeference, it provides the string as above – jay Nov 14 '18 at 20:45
  • @user30184 my question regarding gdal_translate is what is "pixel" and "line" – jay Nov 14 '18 at 20:47

Your Answer

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

Browse other questions tagged or ask your own question.