[GRASS-user] flip raster

beakins Barry.Eakins at NOAA.GOV
Wed Dec 3 16:38:18 EST 2008


Hi all,

I was informed of this forum discussion via email this morning (not being a
GRASS user). We've looked into this issue and the problem lies in how GMT
v.4.3, which was used to create ETOPO1, and GDAL read and write netcdf
grids.  Both purport to handle netcdf COORDS-compliant grids though there is
clearly a problem with one of these applications (the vertical flipping);
the GDAL community forum has apparently already discussed this issue. We're
working on a temporary solution, such as publishing an older "GMT 3.0"
netcdf grid along with the current one that GDAL doesn't read properly. GDAL
does read the older netcdf grid without problem. I hope to have something up
on our web site by next week.

One question that I have: "Is there another file format for the ETOPO1 grids
that would be of more use to the GRASS community than netcdf?" We could host
something such as geotiffs of the grids, which we can create easily, but I'm
not a GRASS user so don't know what grid/raster file format would be easiest
to import into GRASS. I've also never used QGIS.

Any ideas or suggestions would be much appreciated.

Thanks,
Barry Eakins
National Geophysical Data Center

P.S. Sorry about the grid- v. cell-registered grids being a pain, there
really is an important difference between the two.


José María Michia wrote:
> 
> 2008/10/6 Hamish <hamish_b at yahoo.com>:
>> José María Michia wrote:
>>> > I've imported a NetCDF file (ETOPO1 model). The resulted raster
>>> appears
>>> > flipped vertically. How can I fix this?
>>
>> hmmm, this problem sounds vaguely familiar.
>>
>> Is this the dataset from:
>>  http://www.ngdc.noaa.gov/mgg/global/global.html
>>
>> ?
>>
>> if so, which version?  the cell/grid registration thing is a slight pain.
> 
> Yes: grid-registered version, netCDF format.
> 
> The same problem (vertical inversion) occurs with QGIS. Same in GMT,
> with an strange (to me) situation: one GMT program produce normal
> maps.
> 
> The same problem (vertical inversion) is produced with QGIS.
> 
> And so does GMT, but one of GMT programs produce the expected result:
> 
> This, produce vertical inverted map:
> 
> $ grdraster 1 -R-80/-50/-50/-20 -Gargentina.nc
> $ grdimage argentina.nc -JM6i -P -B2 -Ctopo.cpt -V -K > topo.ps
> 
> grdraster extract a subset of netCDF grid. Definition for grdraster id 1
> is:
> 
> 1 "ETOPO1 global topography"    "m"     -R-180/180/-90/90       -I1m
>  GG i 1          0       none
> /mnt/hdb1/geodata/etopo/ETOPO1_Bed_g.grd      B
> 
> And this produces the expected map:
> 
> $ grdcontour -R-80/-50/-50/-20
> /mnt/hdb1/geodata/etopo/ETOPO1_Bed_g.grd -JM6i -P -B2 -C250 -A1000 >
> topo2.ps
> 
> But, this map is a contour map, not raster map. So, is not adequate
> for GRASS import.
> 
> I'm downloading the cell-registered version, I will try again with this
> version.
> 
> With the alternative suggested by Hamish (see below), no need to
> import this file.
> 
> Alexander: Thanks for your suggestion. I will take into account the
> CDO program in the future.
> 
> Another idea for those interested: an alternative might be to use the
> GDAL program to convert the file into another format NetCDF middle, a
> format for which it is possible to import into GRASS. This
> intermediate format can be ASCII, to be able to easily modify it as
> needed.
> 
>> for importing 1' global elevation from:
>>  http://topex.ucsd.edu/marine_topo/mar_topo.html
>> here are some hints, including ETOPO2:
>>  http://grass.osgeo.org/wiki/Marine_Science#Bathymetric_data
> 
> Thanks for the suggestions. I've found the desired data in
> http://topex.ucsd.edu/cgi-bin/get_data.cgi
> 
>>
>> Hamish
> 
> Saludos
> José María
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
> 
> 

-- 
View this message in context: http://www.nabble.com/flip-raster-tp19836768p20708964.html
Sent from the Grass - Users mailing list archive at Nabble.com.



More information about the grass-user mailing list