[GRASSLIST:884] Re: GMT / GRASS use / shp2gmt
Trevor Wiens
twiens at interbaun.com
Wed Apr 26 01:12:47 EDT 2006
On Tue, 25 Apr 2006 16:14:35 -0700 (PDT)
Allan Hollander <adh at ice.ucdavis.edu> wrote:
> Trevor,
>
> I'm a rank beginner at GMT but in my one exercise to date with it I
> learned the following. Mark Fenbers has modified the shp2gmt.c file to
> include the attribute info from the dbf file into the multi-segment
> separator of the psxy input file. His code is given in his message here:
> http://www.mechanik.tu-darmstadt.de/GMT-Help/Archiv/11021.html.
Thanks for the helpful information. I do have a question however.
>
> The output from his shp2gmt version looks like this for a tiny extract
> from a state map of the US:
>
> > Polygon #0 nVertices=17 nParts=1 cat=2 AREA=0 PERIMETER=0.224 STATESP020=3 STATE="Alaska" STATE_FIPS="02"
> -2.86129e+06 6.01613e+06
> -2.86152e+06 6.01607e+06
> -2.86163e+06 6.01615e+06
> -2.86178e+06 6.01631e+06
> -2.86248e+06 6.01724e+06
> -2.86327e+06 6.01807e+06
> etc.
>
OK. Got that code and that is working as reported.
> What I can then do is write an awk script to substitute in the correct
> -G and -W plotting parameters depending on the attributes. For instance
> running this bit of awk over the above input file
>
> {if ($0 ~ /Alaska/) printf "> -G175 -Wblack\n";
> else print;}
You lost me here. In what context am I going to process the file with
awk, in the psxy command line or before hand?
Please provide a slightly more fleshed out example for me to follow.
Thanks in advance.
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