Re: [gdal-dev] Clipping imprecision with gdal_translate

2013-06-04 Thread Eli Adam
gdalwarp does have -tap which may be of some use.  Quoting the doc page:

-tap:(GDAL >= 1.8.0) (target aligned pixels) align the coordinates of
the extent of the output file to the values of the -tr, such that the
aligned extent includes the minimum extent.


Best Regards, Eli

On Tue, Jun 4, 2013 at 12:35 AM, Ari Jolma  wrote:
> JM,
>
> Looks to me that GDAL has clipped to the nearest pixel boundaries and not to
> the window you have provided. This is probably a feature. Maybe gdalwarp
> would do the kind of resampling you wish, but I'm not sure.
>
> Regards,
>
> Ari
>
>
> On 06/03/2013 03:37 PM, JM wrote:
>
> Hello List.
>
>
>
> At first i wanna thanks for the great work you are doing with the gdal
> library. It is a source of great tools and opportunities for spatial issues
> which whom i involed in.
>
>
>
> Among others i am using the commandline tool gdal_translate for clipping
> raster files via the following example command:
>
>
>
> gdal_translate -projwin 13.664938 53.202428
> 13.834784 53.117686 source.tif target.tif
>
>
>
> The source tif is already georeferenced (EPSG:4326). I would now assume that
> the boundingbox of the following GTiff is somethink like this:
>
>
>
> Lower Left: 13.664938 53.117686
>
> Upper Right: 13.834784 53.202428
>
>
>
> Instead it is something like this (the full gdalinfo dialog you can see in
> the attach to this mail):
>
>
>
> Lower Left: 13.610463 53.1000244672
>
> Upper Right: 13.8333191458 53.2000151873
>
>
>
> So there is a small imprecision in the clipping result. My question is now
> if this imprecision is normal (maybe a result of rounding operations within
> the clipping process) or if i do something wrong (do i miss something in my
> command).
>
>
>
> I am using libgdal1 version 1.9.0-3.1ubunut1. Looking forward to hearing
> from you.
>
>
>
> Kind regards,
>
>
>
> JM
>
>
>
>
>
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
>
> ___
> gdal-dev mailing list
> gdal-dev@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] Clipping imprecision with gdal_translate

2013-06-04 Thread Ari Jolma

JM,

Looks to me that GDAL has clipped to the nearest pixel boundaries and 
not to the window you have provided. This is probably a feature. Maybe 
gdalwarp would do the kind of resampling you wish, but I'm not sure.


Regards,

Ari

On 06/03/2013 03:37 PM, JM wrote:


Hello List.

At first i wanna thanks for the great work you are doing with the gdal 
library. It is a source of great tools and opportunities for spatial 
issues which whom i involed in.


Among others i am using the commandline tool gdal_translate for 
clipping raster files via the following example command:


gdal_translate -projwin 13.664938 53.202428 
13.834784 53.117686 source.tif target.tif


The source tif is already georeferenced (EPSG:4326). I would now 
assume that the boundingbox of the following GTiff is somethink like this:


Lower Left: 13.664938 53.117686

Upper Right: 13.834784 53.202428

Instead it is something like this (the full gdalinfo dialog you can 
see in the attach to this mail):


Lower Left: 13.610463 53.1000244672

Upper Right: 13.8333191458 53.2000151873

So there is a small imprecision in the clipping result. My question is 
now if this imprecision is normal (maybe a result of rounding 
operations within the clipping process) or if i do something wrong (do 
i miss something in my command).


I am using libgdal1 version 1.9.0-3.1ubunut1. Looking forward to 
hearing from you.


Kind regards,

JM



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


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