Re: [gdal-dev] Gdal_edit and -gcp as read-only

2021-11-22 Thread Even Rouault

Hi Jukka,

from what I can see in 
https://github.com/OSGeo/gdal/commit/b5128c1ff3ac6ad44b225284f5be1f728840e7b3, 
this dates back to almost 20 years ago when SetGCPs() was initially 
implemented. And at that time, PAM didn't exist yet in GDAL :-)


Please create a ticket about (and mention SetGeoTransform() and 
SetSpatialRef() have the same issue)


Even

Le 22/11/2021 à 14:49, Rahkonen Jukka (MML) a écrit :


Hi,

I tried to add ground control points into a TIFF file with gdal_edit. 
I do not want to touch the TIFF so I used the read-only option and 
supposed that gcp would be written into .aux.xml file but that did not 
happen. Instead I got a message


gdal_edit -ro -gcp 1 1 20 30 test.tif
ERROR 6: test.tif: SetGCPs() is only supported on newly created 
GeoTIFF files.


Without -ro gdal_edit adds ground control points into the TIFF without 
errors. What might be the meaning of the message about “newly created 
GeoTIFF” and is there some way to make gdal_edit to write ground 
control points into PAM file? I know that I can use gdal_translate and 
VRT as a workaround but PAM .aux.xml could be a bit better for my 
whole workflow.


-Jukka Rahkonen-


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


--
http://www.spatialys.com
My software is free, but my time generally not.

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] Gdal_edit and -gcp as read-only

2021-11-22 Thread Rahkonen Jukka (MML)
Hi,

I tried to add ground control points into a TIFF file with gdal_edit. I do not 
want to touch the TIFF so I used the read-only option and supposed that gcp 
would be written into .aux.xml file but that did not happen. Instead I got a 
message

gdal_edit -ro -gcp 1 1 20 30 test.tif
ERROR 6: test.tif: SetGCPs() is only supported on newly created GeoTIFF files.

Without -ro gdal_edit adds ground control points into the TIFF without errors. 
What might be the meaning of the message about "newly created GeoTIFF" and is 
there some way to make gdal_edit to write ground control points into PAM file? 
I know that I can use gdal_translate and VRT as a workaround but PAM .aux.xml 
could be a bit better for my whole workflow.

-Jukka Rahkonen-
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev