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

David Finlayson dfinlays at u.washington.edu
Sat Jul 26 18:09:00 EDT 2003


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




More information about the grass-user mailing list