Re: [gdal-dev] Get bounds of object before reprojection?

2021-07-13 Thread Alan Snow
This might be useful: https://github.com/mapbox/rasterio/pull/2208 On Tue, Jul 13, 2021, 4:21 PM Craig Delancy < cdela...@blackfangtechnologies.com> wrote: > Using the c++ API, how would I go about getting the bounds of a raster > dataset, reprojected into another projection, without actually pe

Re: [gdal-dev] Get bounds of object before reprojection?

2021-07-13 Thread Even Rouault
Craig, you can for example use GDALAutoCreateWarpedVRT() to create a in-memory VRT (without reprojecting any pixel data) in the target projection and query its bounds Even Le 13/07/2021 à 23:21, Craig Delancy a écrit : Using the c++ API, how would I go about getting the bounds of a raster

[gdal-dev] Get bounds of object before reprojection?

2021-07-13 Thread Craig Delancy
Using the c++ API, how would I go about getting the bounds of a raster dataset, reprojected into another projection, without actually performing the reprojection first? Is there a way to do this, or do I have to do the reprojection to get this info? I was thinking I could get the corners and re

Re: [gdal-dev] Computing my overviews for GeoTIFF

2021-07-13 Thread Even Rouault
Le 13/07/2021 à 18:24, Javier Jimenez Shaw a écrit : Sounds good. My next question is how to write the overviews data efficiently. I see that there is a method "GDALRasterBand * GDALRasterBand::GetOverview ( int i ) ", but for that I need to deinterlace the image (copying it), and call it 4 t

Re: [gdal-dev] Computing my overviews for GeoTIFF

2021-07-13 Thread Javier Jimenez Shaw
Sounds good. My next question is how to write the overviews data efficiently. I see that there is a method "GDALRasterBand * GDALRasterBand::GetOverview ( int i ) ", but for that I need to deinterlace the image (copying it), and call it 4 times. Is there any trick I am missing while calling GDALRa

Re: [gdal-dev] Computing my overviews for GeoTIFF

2021-07-13 Thread thomas bonfort
Here's a working c version: https://gist.github.com/tbonfort/1e8630cf4b9bc82471c164e422c1cce7 On Tue, Jul 13, 2021 at 2:55 PM thomas bonfort wrote: > > https://www.mail-archive.com/gdal-dev@lists.osgeo.org/msg36305.html > :) > > On Tue, Jul 13, 2021 at 2:53 PM Javier Jimenez Shaw > wrote: > > >

Re: [gdal-dev] Computing my overviews for GeoTIFF

2021-07-13 Thread thomas bonfort
https://www.mail-archive.com/gdal-dev@lists.osgeo.org/msg36305.html :) On Tue, Jul 13, 2021 at 2:53 PM Javier Jimenez Shaw wrote: > > Thanks Thomas and Even. > > Thomas, about using cogger (that would be great), I forgot to mention that I > am doing it from a C++ library. Is there already a C/C

Re: [gdal-dev] Computing my overviews for GeoTIFF

2021-07-13 Thread Javier Jimenez Shaw
Thanks Thomas and Even. Thomas, about using cogger (that would be great), I forgot to mention that I am doing it from a C++ library. Is there already a C/C++ API? Cheers, Javier .___ ._ ..._ .. . ._. .___ .. __ . _. . __.. ... ._ .__ Entre dos pensamientos racionales hay infinitos pensamie

Re: [gdal-dev] Computing my overviews for GeoTIFF

2021-07-13 Thread thomas bonfort
Javier, You can use https://github.com/airbusgeo/cogger#advanced to do that, provided that you have an internally tiled geotiff. -- thomas On Tue, Jul 13, 2021 at 2:04 PM Even Rouault wrote: > > Javier, > > You can use the "NONE" resampling method in BuildOverviews() or gdaladdo to > create the

Re: [gdal-dev] Computing my overviews for GeoTIFF

2021-07-13 Thread Even Rouault
Javier, You can use the "NONE" resampling method in BuildOverviews() or gdaladdo to create the overviews IFD without allocating any storage, and then you can open the file in update mode to set whatever values you want. APPEND_SUBDATASET=YES will not set the appropriate value for the SubFileT

[gdal-dev] Computing my overviews for GeoTIFF

2021-07-13 Thread Javier Jimenez Shaw
Hi I am computing the overviews of a GeoTIFF on my own (using the GPU, much faster), and I want to include them in the tif file (also in the ovr sidecar file). What is the best way to do it? Just creating a multipage TIFF (I guess with the option APPEND_SUBDATASET=YES)? Is there anything else need