0

I am trying to georeference already georeferenced single band raster data using GDAL with four GCP's.

Input image is having Coordinate system GCS- WGS1984 (EPSG:4326). Following Command is run on command Prompt:

"gdal_translate -of GTiff -gcp 72.4819 23.0179 72.4819 23.0179 -gcp 72.492 23.0079 72.492 23.0079 -gcp 72.4819 23.0086 72.4819 23.0086 -gcp 72.496 23.0169 72.496 23.0169 input.tiff output1.tiff"

"gdalwarp -r near -order 1 -co COMPRESS=NONE -s_srs EPSG:4326 -t_srs EPSG:4326 output1.tiff" output.tiff"

Issues:

  1. After running this command on command prompt and opening output generated file in QGIS the output is not having the coordinate system as EPSG:4326.

  2. Image is opening somewhere else location in QGIS viewer. Hence the image is not properly georeferenced.

  3. I ran georefrencing tool in QGIS with same input dataset it is giving the expected output and image is opening on exact Geographic location.

  4. I copied generated gdal script from QGIS and ran again in Command Prompt and opened output again in QGIS. The image is not as expected.

Questions:

  1. Is this above command is correct for georeferencing already georeferenced data?
  2. Apart from above command Is there any another internal Command QGIS using for georeferencing raster image?
  3. After running gdalwarp, why the output generated is not resampled and not having mentioned coordinate system.
1

1 Answer 1

4

I think you did not understand the -gcp syntax correctly:

-gcp pixel line easting northing elevation
  • pixel = x of point in image dimension
  • line = y of point in image dimension
  • easting = longitude
  • northing = lattitude

So, for example, for the first point you probably want:

-gcp 0 0 72.4819 23.0179 
4
  • Thanx Rovo for answering this question, i understand the use of -gcp well. Since the image is already georeferenced. So, while marking GCP's precisely on this image, pixel coordinates and lat long will be same and this gdal script is generated by QGIS georeferencing plugin. Commented Jul 2, 2018 at 9:38
  • No, you still seem not to understand. pixel and line must be pixels and not coordinates. That is why I highlighted "image dimension". Or is the image 360x180px in size? But anyways, if the image is georeferenced, why do you want to georefence it again?
    – pLumo
    Commented Jul 2, 2018 at 10:50
  • I understand -gcp requirements, that's what i am asking why this type of script is generated by QGIS plugin. I simply copied and ran this script on command prompt expecting the same result as obtained after running georeferencing tool in QGIS. Is QGIS doing something else internaly because this script is not appropriate as per documentation of GDAL. Commented Jul 2, 2018 at 13:22
  • Could be a bug. See the link from @AndreJ's comment on your Question.
    – pLumo
    Commented Jul 2, 2018 at 13:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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