[GRASSLIST:922] Re: GMT / GRASS use / shp2gmt

Trevor Wiens twiens at interbaun.com
Thu Apr 27 02:09:00 EDT 2006


On Wed, 26 Apr 2006 11:30:59 -0700 (PDT)
Allan Hollander <adh at ice.ucdavis.edu> wrote:

> Trevor,
> 
> I'm sorry that was a bit terse. Basically, both the use of shp2gmt and the
> awk script are preprocessing steps before you run psxy. The processing
> flow is like this:
> 
> 1) Run the shp2gmt script over the shapefile to produce a 
> preliminary input file for psxy. In a bash shell, this would be something 
> like:
> 
> % shp2gmt usstates > usstates0.xy
> 
> 2) Run the awk script over the preliminary input file to produce the final
> version of the input file for psxy which is tagged for polygon-by-polygon
> symbology. Assuming the awk script below is in a file named alaska.awk,
> the command line here would be:
> 
> % awk -f alaska.awk usstates0.xy > usstates.xy
> 
> 3) You can then plot this input file using psxy, as follows:
> 
> % psxy usstates.xy [other GMT parameters go here...] >> outputplot.ps
> 
> By the way, there's nothing magical about using awk -- most any scripting 
> language can be used for this sort of processing (a lot of people would 
> use perl, for instance).
> 
> Hope this helps,

Hmm...

OK, now I understand. I think however that probably for my needs having
the ability to select objects by attribute values using SQL is
important so I will probably load my base information into PostGIS and
export my themes as different layers. I will keep this option in mind
however because this way would be faster than going PostGIS to shape
and then shape to xy.

Thanks again.

T
-- 
Trevor Wiens 
twiens at interbaun.com

The significant problems that we face cannot be solved at the same 
level of thinking we were at when we created them. 
(Albert Einstein)




More information about the grass-user mailing list