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


Re: [gdal-dev] setting MAX_Z_ERROR on overviews compressed with LERC_DEFLATE

2021-11-22 Thread Duarte Carreira
So I tried LERC_DEFLATE and MAX_Z_ERROR=0.5 and that worked amazingly! From
350MB DEFLATE PREDICTOR 3, to 45MB...

There are free 32bit elevation data here if anyone's interested:
https://land.copernicus.eu/imagery-in-situ/eu-dem/eu-dem-v1.1?tab=download.

Rahkonen Jukka (MML)  escreveu no dia
quinta, 18/11/2021 à(s) 17:34:

> Hi,
>
>
>
> I have no experience on 32 bit images but play with gdaladdo and
> compression options and report what you find. External overviews (-ro) are
> handy for testing because you can simply rename or delete the .ovr file and
> make new run with other options. External overviews take some more space
> than it takes to add internal overviews into TIFF but best option as
> external should be best as internal too.
>
>
>
> -Jukka Rahkonen-
>
>
>
> *Lähettäjä:* Duarte Carreira 
> *Lähetetty:* torstai 18. marraskuuta 2021 18.30
> *Vastaanottaja:* Rahkonen Jukka (MML)  >
> *Kopio:* gdal-dev@lists.osgeo.org
> *Aihe:* Re: [gdal-dev] setting MAX_Z_ERROR on overviews compressed with
> LERC_DEFLATE
>
>
>
> Well, it didn't even occur to me to compress the overviews with
> translate...
>
> I was expecting a bit more compressing from lerc...
>
>
>
> About tif 32bit, what compression do you think would yield better ratios?
>
>
>
> Thanks.
>
>
>
> Rahkonen Jukka (MML)  escreveu no
> dia quinta, 18/11/2021 à(s) 12:41:
>
> Hi,
>
>
>
> I made some tests with an 8 bit RGB image.
>
> First observation was that gdaladdo supports lerc_deflate (even it is not
> documented), but it does not support “MAX_Z_ERROR”. This yields same sized
> ovr file with or without max_z_error.
>
> gdaladdo -ro lerc_def2.tif --config compress_overview lerc_deflate
> --config MAX_Z_ERROR 10
>
>
>
> Another observation was that this option would really save some disk
> space. I compressed the lossless ovr file with gdal_translate by using -co
> max_z_error=10 and file sizes were:
>
>
>
> source tiff: 432 072 372 bytes
>
> lecr_deflate cog without overviews: 311 258 085 bytes
>
>
>
> lossless lerc_deflate overviews: 118 954 009 bytes
>
> lerc_deflare overviews with z_error=10: 52 400 583 bytes
>
>
>
> For comparison even not relevant to original question about 32 bit data
>
> jpeg-ycbcr overviews with default quality: 14 481 967 bytes
>
>
>
> -Jukka Rahkonen-
>
>
>
> *Lähettäjä:* gdal-dev  *Puolesta *Duarte
> Carreira
> *Lähetetty:* torstai 18. marraskuuta 2021 13.45
> *Vastaanottaja:* gdal-dev@lists.osgeo.org
> *Aihe:* [gdal-dev] setting MAX_Z_ERROR on overviews compressed with
> LERC_DEFLATE
>
>
>
> Hi there.
>
>
>
> I am looking into compressing overviews for a DEM, with LERC_DEFLATE and
> it works. But I'm trying to set the precision loss and get better
> compression, since for overviews I don't really care that much.
>
> Ok, so the question is how to set the MAX_Z_ERROR for overviews compressed
> with LERC_DEFLATE?
>
>
>
> More context:
>
> My reasoning is to compress losslessly the dem with deflate predictor 3,
> and then compress "lossly"  the overviews with lerc_deflate.
>
> Since this is 32bit dataset, I can't use jpeg on the overviews.
>
>
>
> Thanks in advance.
>
> Duarte
>
>
>
>
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev