[GRASS-user] flip raster

José María Michia jose.maria.michia at gmail.com
Wed Oct 8 22:48:07 EDT 2008


2008/10/8 Nikos Alexandris <nikos.alexandris en felis.uni-freiburg.de>:
> On Tue, 2008-10-07 at 01:37 +0100, Glynn Clements wrote:
>> José María Michia wrote:
>>
>> > I've imported a NetCDF file (ETOPO1 model). The resulted raster appears
>> > flipped vertically. How can I fix this? I try with mapcalc, without success:
>> >
>> > - neighborhood modifier: not accept computations in offset parameter, like
>> > map[0,total_rows-row()]
>> > - I dont know how to query map in arbitrary coordinates, like
>> > map(x(),-1*y())
>>
>> There isn't any mechanism in r.mapcalc to achieve this. I'm not sure
>> that it's possible to do it entirely within GRASS. Flipping
>> geo-referenced data doesn't really make much sense.
>>
>> Either figure out how to import it with the correct orientation, or
>> export it, flip the exported data, then re-import.
>
> Glynn and All,
>
> excuse me for hijacking the post. I am looking for a way (just for the
> fun of the game or for philosophical re-search) to rotate geotiffs at
> 180 degrees (i.e. flip vertically and horizontally). I've posted about
> this in the gdal-dev list [1].
>
> Is there a way to accomplish a 180 deg. rotation using the
> listgeo/geotifcp command line tools?

I'm not sure, but maybe this can be useful:

Alexander Schulze suggested me that I use the library to invest CDO latitudes:

http://www.mpimet.mpg.de/fileadmin/software/cdo/

Something like:

cdo invertlat filein fileout1
cdo invertlon fileout1 fileout2

If you can use netCDF format, look at this:

http://nco.wiki.sourceforge.net/reverse a dimension

Saludos
José María

> Thank you, Nikos
>
> [1] http://lists.osgeo.org/pipermail/gdal-dev/2008-October/018548.html
>
>
>


More information about the grass-user mailing list