Re: [gdal-dev] Resampling a raster with gdalwarp

2023-11-19 Thread Even Rouault via gdal-dev
Le 19/11/2023 à 03:08, Giovanni Anconitano a écrit : Thank you very much. Just to be sure, gdalwarp takes the absolute value of the second tr value independently from the units of the pixel size. It can be either meters or degrees depending on the coordinate reference system. Is that correct?

Re: [gdal-dev] Resampling a raster with gdalwarp

2023-11-18 Thread Giovanni Anconitano via gdal-dev
Thank you very much. Just to be sure, gdalwarp takes the absolute value of the second tr value independently from the units of the pixel size. It can be either meters or degrees depending on the coordinate reference system. Is that correct? Thanks again, Giovanni Il giorno sab 18 nov 2023 alle o

Re: [gdal-dev] Resampling a raster with gdalwarp

2023-11-18 Thread Even Rouault via gdal-dev
Giovanni, gdalwarp takes the absolute value of the second tr value, so -tr 10 -10 is understood as -tr 10 10 It is expected that gdalinfo reports a negative value for the pixel size factor for the vertical axis, as in GeoTIFF when the image is north-up, the first line of the image is intende

[gdal-dev] Resampling a raster with gdalwarp

2023-11-18 Thread Giovanni Anconitano via gdal-dev
Hello, I have a question about how to properly set the -tr flag when using gdalwarp. In particular, I'm using gdalwarp for resampling a GeoTiff from its original resolution to a target resolution. Let's consider, for simplicity, the original pixel size equal to (5m, 5m) and the target resolution e

Re: [gdal-dev] resampling algs warp vs translate

2023-09-21 Thread Even Rouault via gdal-dev
That should be relatively straightforward to adapt GDALResampleChunk_AverageOrRMS_T to do sum. Reuse the average code path, but just don't divide the sum by dfTotalWeight at lines 1418, 1473, 1688, 1700 and 1712. And error out if applied to a band with a color table (cf line 4361) For other a

[gdal-dev] resampling algs warp vs translate

2023-09-21 Thread Michael Sumner via gdal-dev
Can we aspire to translate having the same set of resampling algorithms as the warper? I see the warper adds min, max, mod, q1, q3, sum I especially wanted sum for OVERVIEW_RESAMPLING in COG, and I can see where it's done and ... can maybe see my way through that ... but the 600 lines of code i

Re: [gdal-dev] Resampling causes change of max value

2021-05-20 Thread Denis Rykov
Thank you Even. You are totally right as always. The reason is the broken overview. $ gdal_translate -outsize 1% 1% -oo OVERVIEW_LEVEL=0 input_raster_to_resize_with_max_val_92.tiff output-0ovr.tif $ gdal_translate -outsize 1% 1% input_raster_to_resize_with_max_val_92.tiff output.tif $ gdalinfo -

Re: [gdal-dev] Resampling causes change of max value

2021-05-20 Thread Even Rouault
Denis, The maximum of nearest downsampling should be <= maximum of full resolution. Potential explanations: - your source file has overviews that contain completely different values than the full resolution image. - or perhaps your input_raster_to_resize_with_max_val_92.tiff file has a .aux

[gdal-dev] Resampling causes change of max value

2021-05-20 Thread Denis Rykov
$ gdalinfo -stats -json input_raster_to_resize_with_max_val_92.tiff | jq '.bands[0].metadata[""].STATISTICS_MAXIMUM' "92" $ gdal_translate -outsize 1% 1% input_raster_to_resize_with_max_val_92.tiff output.tif Input file size is 6845, 10302 0...10...20...30...40...50...60...70...80...90...100 - done

[gdal-dev] resampling netcdf data

2020-11-21 Thread Nazanin tavakoli
Hello, I want to change the resolution of my data whose resolution is 0.0416 degrees (1/24th) resolution and I want to convert it to 0.5 degrees. I have already used this code but I have some errors. Could you please help me? gdal_translate -of netCDF -tr 0.5 0.5 WS.nc

Re: [gdal-dev] Resampling on the GPU using Apple Metal

2020-03-05 Thread Even Rouault
On jeudi 5 mars 2020 22:05:59 CET John Daniel wrote: > Hello everyone, > I am investigating adding support for Apple Metal to GPU resampling in GDAL. > This is what I've learned so far: > > 1) Currently, OpenCL is only used for resampling operations via gdalwarp. > RasterIO resampling via gdal_tra

[gdal-dev] Resampling on the GPU using Apple Metal

2020-03-05 Thread John Daniel
Hello everyone, I am investigating adding support for Apple Metal to GPU resampling in GDAL. This is what I've learned so far: 1) Currently, OpenCL is only used for resampling operations via gdalwarp. RasterIO resampling via gdal_translate does not use OpenCL. This makes gdal_translate, and Ra

[gdal-dev] Resampling rasters with search radius

2018-02-22 Thread Nicolas Cadieux
Hi, I am creating rasters with Lidar data using GDAL grid. I have very large datasets. This raster has 1m pixels. For now, I am using nearest neighbours with a 1x1 m. radius. This is fast. My goal is then to make 4 rasters all having the same 30 m pixel posting but I want these new rasters

Re: [gdal-dev] Resampling a raster file with GDAL C#

2016-04-18 Thread Didier Bernard
dvance! Didier From: gdal-dev on behalf of Jukka Rahkonen Sent: Tuesday, April 19, 2016 12:39 AM To: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] Resampling a raster file with GDAL C# Didier Bernard hotmail.com> writes: > Are you suggesting to simply conve

Re: [gdal-dev] Resampling a raster file with GDAL C#

2016-04-18 Thread Jukka Rahkonen
Didier Bernard hotmail.com> writes: > Are you suggesting to simply convert the .tif file from command prompt by using gdal_translate? Like so: > > "C:/gdalwin32-1.4.1/bin/gdal_translate.exe" -of VRT "C:/vesuvius_wgs84.tif" "C:/vesuvius_wgs84.vrt" > > ? > > And "build" my .vrt file accord

Re: [gdal-dev] Resampling a raster file with GDAL C#

2016-04-18 Thread Didier Bernard
. From: Even Rouault Sent: Monday, April 18, 2016 10:40 PM To: Didier Bernard Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] Resampling a raster file with GDAL C# Le lundi 18 avril 2016 22:35:42, Didier Bernard a écrit : > Hi Even, > >

Re: [gdal-dev] Resampling a raster file with GDAL C#

2016-04-18 Thread Didier Bernard
ou. Didier From: Even Rouault Sent: Monday, April 18, 2016 10:25 PM To: gdal-dev@lists.osgeo.org Cc: Didier Bernard Subject: Re: [gdal-dev] Resampling a raster file with GDAL C# Le lundi 18 avril 2016 19:59:32, Didier Bernard a écrit : > Hello, > > > I a

Re: [gdal-dev] Resampling a raster file with GDAL C#

2016-04-18 Thread Even Rouault
code until it produces the same result. > > Thank you. > Didier > > > From: Even Rouault > Sent: Monday, April 18, 2016 10:25 PM > To: gdal-dev@lists.osgeo.org > Cc: Didier Bernard > Subject: Re: [gdal-dev] Resampling a raster file with GDAL

Re: [gdal-dev] Resampling a raster file with GDAL C#

2016-04-18 Thread Even Rouault
Le lundi 18 avril 2016 19:59:32, Didier Bernard a écrit : > Hello, > > > I am trying to resample a .tif raster in C# GDAL in a way that every other > cell in a row and column is removed. > > Something similar to the lower GDAL command: > > gdal_translate -outsize 50% 0 input.tif output.tif

[gdal-dev] Resampling a raster file with GDAL C#

2016-04-18 Thread Didier Bernard
Hello, I am trying to resample a .tif raster in C# GDAL in a way that every other cell in a row and column is removed. Something similar to the lower GDAL command: gdal_translate -outsize 50% 0 input.tif output.tif But this command creates a new resampled .tif file. While I would like to

[gdal-dev] Resampling with GDAL Warp API

2011-04-21 Thread morabit
Hi All, in our project we have to resample some datasets (specifically dted tiles) and we want to use the GDAL Warp API. >From the API tutorial in the online documentation is not clear how to accomplish this task. Another complication is due to the fact that we want to produce the result of resam

[gdal-dev] Resampling using RPCs

2011-02-23 Thread Jorge Martin
Hello, I have to make a resampling from a source image in Lat/Long coordinates to UTM target image. If I take the GCPs of the source image in Lat/long the RPCs works very good, but if I get this points and tranform the to UTM (with the same zone of the target image) and compute the

Re: [gdal-dev] resampling techniques in GDAL

2009-07-05 Thread Markus Neteler
On Wed, Jun 17, 2009 at 12:52 AM, Gregory, Matthew wrote: > Hi all, > > A recent post got me thinking about resampling techniques.  I've posted > a graphic to help illustrate my question. > >  http://www.fsl.orst.edu/lemma/sandbox/resample.png > > In the graphic, assume the input image is the 3x3 g

Re: [gdal-dev] resampling techniques in GDAL

2009-06-16 Thread Seth Price
The reason that what you are suggesting isn't done is mainly speed and simplicity. GDAL makes the assumption that you are warping from one resolution to another, similar, resolution. The current scheme works well for that. However, I believe that Cubic Spline and Lanczos resampling both do what yo

Re: [gdal-dev] resampling techniques in GDAL

2009-06-16 Thread Frank Warmerdam
Gregory, Matthew wrote: Hi all, A recent post got me thinking about resampling techniques. I've posted a graphic to help illustrate my question. http://www.fsl.orst.edu/lemma/sandbox/resample.png In the graphic, assume the input image is the 3x3 grid with black outlines and blue and yell

[gdal-dev] resampling techniques in GDAL

2009-06-16 Thread Gregory, Matthew
Hi all, A recent post got me thinking about resampling techniques. I've posted a graphic to help illustrate my question. http://www.fsl.orst.edu/lemma/sandbox/resample.png In the graphic, assume the input image is the 3x3 grid with black outlines and blue and yellow dot centers. Assume the

RE: [gdal-dev] Resampling.

2009-06-16 Thread Belaid MOA
That's exactly what I was looking for! Thank you very ... very much Frank. With best regards. ~Belaid ... > Date: Tue, 16 Jun 2009 09:43:35 -0400 > From: warmer...@pobox.com > To: belaid_...@hotmail.com > CC: gdal-dev@lists.osgeo.org > Subject: Re: [gdal-dev] Resampling. &

Re: [gdal-dev] Resampling.

2009-06-16 Thread Frank Warmerdam
Belaid MOA wrote: Hi everyone, I am new to GDAL and I need some help on how to do re-sampling (programmatically). I have 30mx30m Geotiff images and I'd like to resample them into 25mx25m Geotiff images. Any help on this is very appreciated. Belaid, One approach to do this would be a com

[gdal-dev] Resampling.

2009-06-15 Thread Belaid MOA
Hi everyone, I am new to GDAL and I need some help on how to do re-sampling (programmatically). I have 30mx30m Geotiff images and I'd like to resample them into 25mx25m Geotiff images. Any help on this is very appreciated. Thanks a lot in advance. With best regards. ~Belaid ... __

Re: [gdal-dev] resampling a raster data set on the commandline

2008-12-09 Thread Frank Warmerdam
Andreas Neumann wrote: Hi all, I need to resample raster files on the command line. First I thought that resampling would be an option of gdal_translate, but it seems like it isn't implemented and there is a patch pending: http://trac.osgeo.org/gdal/ticket/1724 - but this patch is against an ol

[gdal-dev] resampling a raster data set on the commandline

2008-12-09 Thread Andreas Neumann
Hi all, I need to resample raster files on the command line. First I thought that resampling would be an option of gdal_translate, but it seems like it isn't implemented and there is a patch pending: http://trac.osgeo.org/gdal/ticket/1724 - but this patch is against an old version. gdal_warp all

Re: [gdal-dev] resampling artifacts

2008-11-10 Thread Brent Fraser
Even, It is fixed in v1.6 Beta. Thanks! Brent Even Rouault wrote: Brent, Have you tried with GDAL 1.6.0 beta ? Much work has been done in that area and those artifacts should have disappeared and people. See http://trac.osgeo.org/gdal/ticket/2627 Le Friday 07 November 2008 00:08:51 Bren

Re: [gdal-dev] resampling artifacts

2008-11-07 Thread Brent Fraser
Thanks Even, I'll try the 1.6.0 beta. Even Rouault wrote: Brent, Have you tried with GDAL 1.6.0 beta ? Much work has been done in that area and those artifacts should have disappeared and people. See http://trac.osgeo.org/gdal/ticket/2627 Le Friday 07 November 2008 00:08:51 Brent Fraser, vo

Re: [gdal-dev] resampling artifacts

2008-11-06 Thread Even Rouault
Brent, Have you tried with GDAL 1.6.0 beta ? Much work has been done in that area and those artifacts should have disappeared and people. See http://trac.osgeo.org/gdal/ticket/2627 Le Friday 07 November 2008 00:08:51 Brent Fraser, vous avez écrit : > Has anyone experienced resampling artifacts

[gdal-dev] resampling artifacts

2008-11-06 Thread Brent Fraser
Has anyone experienced resampling artifacts using gdalwarp? I'm using v1.5.2, and with lanczos or cubicspline resampling, I get a vertical line and a horizontal line of seemingly random pixels about 6 pixels wide running through the center of the output image. I'm resampling a 16-bit t