Re: [gdal-dev] slow translate with OVERVIEW_LEVEL=NONE when no overviews exist

2023-11-24 Thread Even Rouault via gdal-dev

Hi Michael,

Le 25/11/2023 à 00:44, Michael Sumner via gdal-dev a écrit :
When I translate this GeoTIFF to 10% original size, it's very very 
slow if OVERVIEW_LEVEL=NONE is set.


Fixed per https://github.com/OSGeo/gdal/pull/8819

Even

--
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


Re: [gdal-dev] slow translate with OVERVIEW_LEVEL=NONE when no overviews exist

2023-11-24 Thread Scott via gdal-dev

Over the network it takes 23 seconds:

time gdal_translate -oo OVERVIEW_LEVEL=NONE -outsize 219 226 
/vsicurl/https://github.com/mdsumner/cog-example/raw/main/cog/sentinel-image.tif 
net.tif

real  0m23.909s
user  0m4.374s
sys   0m1.021s

Saving the file locally and translating it's fractional second:

time gdal_translate -oo OVERVIEW_LEVEL=NONE -outsize 219 226 sent.tif 
local.tif

real  0m0.143s
user  0m0.107s
sys   0m0.036s

My guess is there are numerous reads of the file and across a network, 
depending on server load, etc, it may take muchlonger.


On 11/24/23 15:44, Michael Sumner via gdal-dev wrote:
When I translate this GeoTIFF to 10% original size, it's very very slow 
if OVERVIEW_LEVEL=NONE is set.


The GeoTIFF has no overviews.

export 
dsn="/vsicurl/https://github.com/mdsumner/cog-example/raw/main/cog/sentinel-image.tif "

## takes *forever*
gdal_translate $dsn  out.tif -outsize 219 226 -oo OVERVIEW_LEVEL=NONE

## works fast as expected
gdal_translate $dsn  out.tif -outsize 219 226

I found this in a package that has a global open option setting for 
overviews for subsampling with RasterIO(). There we could detect that 
overviews are not present, or even just not set it at all ... (better to 
use GDALwarp() for general cases IMO).


But, is there a good reason why setting that open option affects 
translate for sources with no overviews?


I'm in master at ebac6b74a429fa6eeeb94edd074b6cb60072a35f

Cheers, Mike



--
Michael Sumner
Software and Database Engineer
Australian Antarctic Division
Hobart, Australia
e-mail: mdsum...@gmail.com 

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

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


[gdal-dev] slow translate with OVERVIEW_LEVEL=NONE when no overviews exist

2023-11-24 Thread Michael Sumner via gdal-dev
When I translate this GeoTIFF to 10% original size, it's very very slow if
OVERVIEW_LEVEL=NONE is set.

The GeoTIFF has no overviews.

export dsn="/vsicurl/
https://github.com/mdsumner/cog-example/raw/main/cog/sentinel-image.tif;
## takes *forever*
gdal_translate $dsn  out.tif -outsize 219 226 -oo OVERVIEW_LEVEL=NONE

## works fast as expected
gdal_translate $dsn  out.tif -outsize 219 226

I found this in a package that has a global open option setting for
overviews for subsampling with RasterIO(). There we could detect that
overviews are not present, or even just not set it at all ... (better to
use GDALwarp() for general cases IMO).

But, is there a good reason why setting that open option affects translate
for sources with no overviews?

I'm in master at ebac6b74a429fa6eeeb94edd074b6cb60072a35f

Cheers, Mike



-- 
Michael Sumner
Software and Database Engineer
Australian Antarctic Division
Hobart, Australia
e-mail: mdsum...@gmail.com
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev