[Xastir] ESRI shapefiles and dbfawk

Tom Russo russo at bogodyn.org
Wed Dec 15 10:53:35 EST 2004


On Wed, Dec 15, 2004 at 08:37:24AM -0700, we recorded a bogon-computron collision of the <russo at bogodyn.org> flavor, containing:
> On Wed, Dec 15, 2004 at 01:53:04AM -0700, we recorded a bogon-computron collision of the <jewen at shaw.ca> flavor, containing:
> > I do see that I have a parsing problem with the dbfinfo line. I can't see
> > what's wrong there. It's simply a line with all the labels in it, separated
> > by colons...

If you're using the "ROADSEG" shapefile from the Alberta shapefile set,
the output of testawk is:

NID:DATASETNAM:SPECVERS:ACCURACY:ACQTECH:ACQPROVIDR:ACQREVDATE:NATRDCLASS:RTNUMBER1:RTNUMBER2:RTNUMBER3:RTNUMBER4:RTNUMBER5:RTENAME1FR:RTENAME2FR:RTENAME3FR:RTENAME4FR:RTENAME1EN:RTENAME2EN:RTENAME3EN:RTENAME4EN:EXITNBR:NBRLANES:PAVSTATUS:PAVSURF:UNPAVSURF:STRUCTID:STRUCTTYPE:STRUNAMEFR:STRUNAMEEN:ROADSEGID

So if you cut/paste this into your dbfinfo variable it should match.

FWIW, I used the attached dbfawk file on the Alberta shapefile testawk seemed
to show it was working for labeling freeways and setting their lanes/color.
It should give you a starting point for further work.

HTH,
T.
-- 
Tom Russo    KM5VY     SAR502  DM64ux         http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://www.qsl.net/~km5vy/
 "That which does not kill me is better than that which does."
    --Irving Nietzche, lesser known of the famous Nietzche twins
-------------- next part --------------
# $Id$

# BEGIN is called once per dbf file which contains multiple records.
BEGIN {
# dbfinfo is the "signature" of the dbf file listing the column names in order.
# dbfinfo should match the dbf file that we say this dbfawk file goes with.
dbfinfo="NID:DATASETNAM:SPECVERS:ACCURACY:ACQTECH:ACQPROVIDR:ACQREVDATE:NATRDCLASS:RTNUMBER1:RTNUMBER2:RTNUMBER3:RTNUMBER4:RTNUMBER5:RTENAME1FR:RTENAME2FR:RTENAME3FR:RTENAME4FR:RTENAME1EN:RTENAME2EN:RTENAME3EN:RTENAME4EN:EXITNBR:NBRLANES:PAVSTATUS:PAVSURF:UNPAVSURF:STRUCTID:STRUCTTYPE:STRUNAMEFR:STRUNAMEEN:ROADSEGID";
#dbffields is which of the above fields we actually want to look at.
# No point reading dbffields that are not looked at further.
dbffields="NATRDCLASS:RTNUMBER1:RTENAME1EN"}

# BEGIN_RECORD is called once per dbf record which contains multiple fields.
# Use this rule to re-initialize variables between records.
# use color 11 to highlight stuff that isn't properly mapped.
BEGIN_RECORD {key=""; lanes=1; color=8; fill_color=11; name=""; filled=0; pattern=0; display_level=8192; label_level=32; label_color=8; font_size=0; symbol=""; fill_style=0 }

/^NATRDCLASS=Freeway/ {lanes=4; color=4; next}
/^RTENAME1EN=(.+)/ {name=$1;next}


More information about the Xastir mailing list