[gdal-dev] GDAL Java Bindings - Convert raster from [0, 360] to [-180, 180]
mdsumner at gmail.com
Mon Jul 13 07:21:58 PDT 2015
Ahem, I think this is the original tutorial intended by Trent:
See lower down under "Virtual files".
(The other page was specific to another project, now defunct - though it
did source from this original GDAL tutorial)
On Tue, 14 Jul 2015 at 00:09 Hare, Trent <thare at usgs.gov> wrote:
> The problem with warping is that you might incur resampling. Here is an
> older thread, no longer exists beside in the wayback machine, which
> explains how you can swap sides using pixel tricks in a VRT header
> (pointing to your original data).
> It should be fairly easy to script up something to do this general also. I
> use this trick to no only swap from 180 to 360 but also support WMS layers
> from -180 to 360 (540 degrees total) without duplicating data. That way WMS
> clients can call either ranges from -180 to 180 or 0 to 360.
> On Mon, Jul 13, 2015 at 1:21 AM, johie <jesse.hietanen at gmail.com> wrote:
>> I'm processing some global GRIB2/netCDF data which have East-West
>> coordinates of 0-360 degrees. I need to have the output data on typical
>> -180, 180 range to process them later with some other data. When I
>> them to WGS84 and convert to GeoTiff, the output is still 0-360.
>> I found that I can then warp that output GeoTiff using the command line
>> gdal: gdalwarp -t_srs WGS84 input360.tif output180.tif --config
>> 0 -wo SOURCE_EXTRA=1000
>> This work just fine and the output is correct. But I would need to do this
>> using the Java bindings. I can pass the Center Long with:
>> gdal.SetConfigOption("CENTER_LONG", "0"); But not the Source_Extra, which
>> WarpingOptions if I understood correctly? In java there seems to be no way
>> to pass these warping options when using AutoCreatedWarped and Create (see
>> processing flow:
>> Is there some workaround to this using the Java?
>> This is how the output looks when processing with the Java (Data is lost
>> the white "stripe"). This looks the same as using the gdalwarp without
>> Thanks a lot!
>> View this message in context:
>> Sent from the GDAL - Dev mailing list archive at Nabble.com.
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev