[GRASSLIST:825] Re: Problems importing a GMT grd file

Sandro Klippel sandro.klippel at talha-mar.com.br
Sat Jul 26 19:09:31 EDT 2003


David,

I get the same error on your binary file. But the converted file from
gmt grid work fine. So, the problem is in your 'grdreformat'.

I put the new binary file on:

www.talha-mar.com.br/programas/triangle2.zip

output of grdinfo:

triangle.grd: Title: 
triangle.grd: Command: triangulate -JX25i/40i median.xyz -I10 -E
-Gtriangle.grd -R534090/548020/5322430/5346610 -V -M
triangle.grd: Remark: 
triangle.grd: Normal node registration used
triangle.grd: grdfile format # 0
triangle.grd: x_min: 534090 x_max: 548020 x_inc: 10 units: user_x_unit
nx: 1394
triangle.grd: y_min: 5.32243e+06 y_max: 5.34661e+06 y_inc: 10 units:
user_y_unit ny: 2419
triangle.grd: z_min: -11.8154 z_max: 47.3911 units: user_z_unit
triangle.grd: scale_factor: 1 add_offset: 0

output of r.info:

Type of Map:  raster              Number of Categories: 255             
Data Type:    FCELL                                                     
Rows:         2419                                                      
Columns:      1394                                                      
Total Cells:  3372086                                                   
Projection: UTM (zone 0)                                            
N:    5346610    S:    5322430   Res: 9.99586606                
E:     548020    W:     534090   Res: 9.9928264                 
Range of data:    min =  -11.815351 max = 47.391102                     
Data Source:                                                            
Data Description: generated by r.in.bin

On Sat, 2003-07-26 at 19:09, David Finlayson wrote:
> I placed the files on our web server:
> 
> http://www.ocean.washington.edu/data/pugetsound/grass/triangle.zip
> 
> Thanks for your help with this.
> 
> David
> 
> Sandro Klippel wrote:
> > Perhaps you right. I'm not know cygwin, but it worked pretty well on
> > linux (grdreformat-r.in.bin).
> > 
> > I can test it for you. Send me your arquives (both .grd and .bin).
> > 
> > On Sat, 2003-07-26 at 16:40, David Finlayson wrote:
> > 
> >>I removed the -R and got the same result.  I wonder if this is a cygwin 
> >>problem?
> >>
> >>Triangle.grd works fine in GMT plots.  Something is falling appart 
> >>during either the reformat step or during import.
> >>
> >>Unfortuantley, I don't have a linux box with grass installed to verify that.
> >>
> >>David
> >>
> >>Sandro Klippel wrote:
> >>
> >>>David,
> >>>
> >>>you should not put the '-R' option without specify boundaries. You only
> >>>need this to select partial areas from original grid.
> >>>
> >>>try,
> >>>
> >>>grdreformat triangle.grd=0 triangle.bin=1 -V (without '-R')
> >>>
> >>>
> >>>Sandro.
> >>>
> >>>On Sat, 2003-07-26 at 03:53, David Finlayson wrote:
> >>>
> >>>
> >>>>I tried the grdreformat line as you suggested, now r.in.bin gives the 
> >>>>following error:
> >>>>
> >>>>North must be larger than South
> >>>>
> >>>>Has the header been corrupted in the conversion?  Does r.in.bin accept 
> >>>>scientific (exponential) notation in the header?  The Northing 
> >>>>coordinates are given in exponential notiation in triangle.grd as you 
> >>>>can see below in my first post.
> >>>>
> >>>>This is a UTM Zone 10 grid created from XYZ data with the following 
> >>>>script (Note the UTM coordinates and non-geographic projection):
> >>>>
> >>>>echo " *** Filter the data and convert to grid *** "
> >>>>gmtconvert 02022_utm.xyz -bo > utm.b
> >>>>blockmedian utm.b -bi -I10 -R534090/548020/5322430/5346610 -V > median.xyz
> >>>>
> >>>>echo " *** Build Triangle Grid *** "
> >>>>triangulate median.xyz -I10 -E -Gtriangle.grd -R -JX25i/40i -V -M > 
> >>>>lines.dat
> >>>>
> >>>>echo " *** Convert Grid to proper type for GRASS *** "
> >>>>grdreformat triangle.grd=0 triangle.bin=1 -V -R
> >>>>
> >>>>Then in GRASS:
> >>>>
> >>>>r.in.bin -fh in=triangle.bin out=shoals.gmt
> >>>>
> >>>>Thanks for your help!
> >>>>
> >>>>David
> >>>>
> >>>>Sandro Klippel wrote:
> >>>>
> >>>>
> >>>>
> >>>>>Try use 
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>grdreformat triangle.grd=0 triangle.bin=1
> >>>>>
> >>>>>
> >>>>>and then
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>r.in.bin -hf in=triangle.bin out=shoals.gmt
> >>>>>
> >>>>>
> >>>>>On Fri, 2003-07-25 at 15:18, David Finlayson wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>>>I have created a GMT grid file from point data using GMT's triangulate 
> >>>>>>command.  When I tried to import the grd with r.in.bin, I received an 
> >>>>>>error saying there was an invalid row value. Is there something I am 
> >>>>>>doing wrong?
> >>>>>>
> >>>>>>Here are some details:
> >>>>>>
> >>>>>>GRASS:~/shoals > gridinfo triangle.grd
> >>>>>>triangle.grd: Title:
> >>>>>>triangle.grd: Command: triangulate -JX25i/40i median.xyz -I2 -E 
> >>>>>>-Gtriangle.grd -R534090/548020/5322430/5346610 -V -M
> >>>>>>triangle.grd: Remark:
> >>>>>>triangle.grd: Normal node registration used
> >>>>>>triangle.grd: grdfile format # 0
> >>>>>>triangle.grd: x_min: 534090 x_max: 548020 x_inc: 2 units: user_x_unit 
> >>>>>>nx: 6966
> >>>>>>triangle.grd: y_min: 5.32243e+06 y_max: 5.34661e+06 y_inc: 2 units: 
> >>>>>>user_y_unit ny: 12091
> >>>>>>triangle.grd: z_min: -11.945 z_max: 48.91 units: user_z_unit
> >>>>>>triangle.grd: scale_factor: 1 add_offset: 0
> >>>>>>
> >>>>>>GRASS:~/shoals > r.in.bin -hf in=triangle.grd out=shoals.gmt
> >>>>>>Illegal row value
> >>>>>>
> >>>>>>I am using GRASS 5.0.2 (April 2003) and GMT 3.4.3 both on Cygwin/XP
> >>>>>>
> >>>>>>Thanks
> >>>>>>
> >>>>>>
> >>>>>>-- 
> >>>>>>David Finlayson
> >>>>>>School of Oceanography
> >>>>>>Box 357940
> >>>>>>University of Washington
> >>>>>>Seattle, WA  98195-7940
> >>>>>>USA
> >>>>>>
> >>>>>>Office: Marine Sciences Building, Room 112
> >>>>>>Phone: (206) 616-9407
> >>>>>>Web: http://students.washington.edu/dfinlays
> >>>>
> >>>>-- 
> >>>>David Finlayson
> >>>>School of Oceanography
> >>>>Box 357940
> >>>>University of Washington
> >>>>Seattle, WA  98195-7940
> >>>>USA
> >>>>
> >>>>Office: Marine Sciences Building, Room 112
> >>>>Phone: (206) 616-9407
> >>>>Web: http://students.washington.edu/dfinlays
> >>
> >>-- 
> >>David Finlayson
> >>School of Oceanography
> >>Box 357940
> >>University of Washington
> >>Seattle, WA  98195-7940
> >>USA
> >>
> >>Office: Marine Sciences Building, Room 112
> >>Phone: (206) 616-9407
> >>Web: http://students.washington.edu/dfinlays
> 
> -- 
> David Finlayson
> School of Oceanography
> Box 357940
> University of Washington
> Seattle, WA  98195-7940
> USA
> 
> Office: Marine Sciences Building, Room 112
> Phone: (206) 616-9407
> Web: http://students.washington.edu/dfinlays
-- 
Sandro Klippel <sandro.klippel at talha-mar.com.br>

talha-mar projetos ambientais
Conselheiro d'Avila 190 
Porto Alegre,RS 91040-450
+55 (51) 3344-7451

w w w . t a l h a - m a r . c o m . b r




More information about the grass-user mailing list