[gdal-dev] onestep vs twostep reproject and change format

Even Rouault even.rouault at mines-paris.org
Tue Jan 29 00:19:55 PST 2013


Selon Terry Rankine <terry.rankine at csiro.au>:

> Hi Guys
>
> I have an ERS (ermapper) dataset I want to reproject into wsg84 and then
> change the file format to netcdf4. I am using GDAL 1.9.2 linked against
> netcdf 4.1.3
>
> I get different results using the following.
>
> One step:
> * gdalwarp /projects/r17/GA/GSQ_P1247tmig.ers -s_srs "+proj=latlong
> +datum=GDA94" -t_srs "+proj=latlong +datum=WGS84" -r cubic -of NETCDF
> -overwrite -co "FORMAT=NC4" -co "COMPRESS=DEFLATE" -co "ZLEVEL=9" -dstnodata
> -99999 onestep.nc4
>
> Two step
> * gdalwarp -of ERS -s_srs "+proj=latlong +datum=GDA94" -t_srs "+proj=latlong
> +datum=WGS84" -r cubic /projects/r17/GA/GSQ_P1247tmig.ers reproj.ers
> -dstnodata -99999
> * gdal_translate -of netCDF -co "FORMAT=NC4" -co "COMPRESS=DEFLATE" -co
> "ZLEVEL=9" -stats reproj.ers reproj.nc4
>
> In fact - the onestep destroys part of my data.
> OneStep output
> <http://osgeo-org.1560.n6.nabble.com/file/n5030451/onestep.nc4>
>
> two step output:
> <http://osgeo-org.1560.n6.nabble.com/file/n5030451/reproj.nc4>
>
> Can someone let me know what I am doing wrong?

Nothing. The netCDF driver would need enhancements to fully support random
writing. I believe there are already tickets in Trac about that, or there was a
related discussion on that topic some time ago. The 2 step method is the
recommanded one for the time being.

For the one step process, you could perhaps try adding -wo OPTIMIZE_SIZE=TRUE
(see
http://gdal.org/structGDALWarpOptions.html#a0ed77f9917bb96c7a9aabd73d4d06e08 ).
This will perhaps work, but at the expense of a slow warping in some situations.









































More information about the gdal-dev mailing list