[Xastir] Virginia dbfawk issue

Tom Russo russo at bogodyn.org
Sun Apr 15 19:35:10 EDT 2007


On Sun, Apr 15, 2007 at 04:05:57PM -0400, we recorded a bogon-computron collision of the <brown at brauhaus.org> flavor, containing:
> 
> This isn't a huge thing, but, Virginia has a number of "independent cities"
> in addition to counties. The dbfawk files included with xastir, which get
> installed in the /usr/local/share/xastir/config dir, append the word "County"
> or "Parish" to county names. This leads to the following:
> 
[...]
> 
> Above, Prince William is a county, but City of Manassas and City of
> Manassas park are independent cities, and shouldn't have "County" appended. 
> I've been trying to figure out how to fix nwsc_ddmmyy.dbfawk, but haven't
> been having much luck. Suggestions? 

This is an issue with the "tgrcty.dbfawk" and "tgrwat.dbfawk" files, which
are the only two that append "County" to county names.  That's done by
the following rules:

/^COUNTY=(.*)$/ {name="$1"; next}
/^FIPSSTCO=(22.*)$/ {name="$name Parish"; key=$1; next}
/^FIPSSTCO=(.*)$/ {name="$name County"; key=$1; next}


The first rule sets the initial name to the name of the county.  The second
pair of rules sets the suffix to "Parish" if the FIPS code is one relating
to Louisiana, and County otherwise.

To short circuit this set of rules to skip the suffix would be a tad
tricky, because DBFAWK doesn't have any kind of state that can be set by
one rule to be used in the next (like an "iscity" variable), and each 
DBF field is independently parsed, so you can't do boolean combination rules.
You essentially have to rework how the dbfawk file is set up.

Right now, because of the
dbffields="COUNTY:FIPSSTCO";
line, the COUNTY field is parsed first, and the FIPSSTCO is parsed second
to get the suffix after the county name is worked out.  You could, however, 
flip them around:

dbffields="FIPSSTCO:COUNTY";

and then do:

/^FIPSSTCO=(22.*)$/ {name="Parish"; key=$1; next}
/^FIPSSTCO=(.*)$/ {name="County"; key=$1; next}
/^COUNTY=(City of .*)$/ {name="$1"; next}
/^COUNTY=(.*)$/ {name="$1 $name"; next}

so that the County/Parish suffix is set into name first, and discarded if
the "County" name actually contains the phrase "City of"

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://kevan.org/brain.cgi?DDTNM
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
 one trick, rational thinking, but when you're good and crazy, oooh, oooh,
 oooh, the sky is the limit!"  --- The Tick



More information about the Xastir mailing list