# $Id: tgrlk.dbfawk,v 1.14 2009/01/02 07:53:58 we7u Exp $ # # Copyright (C) 2003-2009 The Xastir Group # # This dbfawk file is used to map arbitrary dbf data that accompanies # a shapefile into Xastir canoncical values of: # key - search key # lanes - width of feature (usually a road but applies to rivers, etc. too) # color - color to draw the road # name - name of the road for labels # filled - whether a polygon is drawn filled or not # fill_color - color to fill polygon with # pattern - line pattern for road, river, etc. (0 - solid; 1 - dash; 2 - double dash) # display_level - highest zoom level at which to display the feature # label_level - highest zoom level at which to display the label # symbol - 3 char 'TIO': table, ID, overlay # NOTE: This file format is modeled after awk but is nowhere near awk # compatible. # # This file is used to map US Census Tiger/Line "lk" shapefiles which are # named tgrSSCCClk[A-H].dbf, where SSCCC are the FIPS state and county codes. # 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="osm_id:name:type"; # dbffields is which of the above fields we actually want to look at. # No point reading dbffields that are not looked at further. dbffields="name:type"; } # 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=""} # per-field rules are applied to the dbffields that are read from each record. # key: set the search key to be the Tiger/Line ID. Not currently used. #/^TLID=(.*)$/ {key=$1; next} # name: concatenate FEDIRP (direction prefix), FENAME (name), # FETYPE (type: Rd, Ln, Pky, etc.) and FEDIRS (direction suffix). # also abbreviate United States Highway to US, etc. /^name=(.*)/ {name="$1 ";next} /^type=water/ {lanes=0; color=26; fill_color=26; label_color=26} /^type=river*/ {lanes=0; color=26; fill_color=26; label_color=26} /^type=forest/ {lanes=0; color=100; fill_color=100; label_color=100} /^type=park/ {lanes=0; color=10; fill_color=10; label_color=10} # (G not used by census; tig2aprs uses for special maps) # H: hydrography # H00 - water feature # H01 - shoreline of perennial water feature # H02 - shoreline of intermittent " # H10 - stream # H11 - perennial stream # H12 - intermittent stream # H13 - braided stream or river # H20 - canal, ditch or aqueduct # H21 - perennial " # H22 - intermittent " # H30 - lake or pond # H31 - perennial " # H32 - intermittent " # H40 - reservoir # H41 - perennial " # H42 - intermittent " # H50 - bay, estuary, gulf, sound, sea, ocean # H51 - bay, estuary, gulf or sound # H52 - sea or ocean # H60 - gravel pit or quarry filled with water # H70 - nonvisibile.... # H80 - special water features # H81 - glacier #/^CFCC=H/ {lanes=0; color=26; fill_color=26; label_color=26} #/^CFCC=H02/ {pattern=2; next} #/^CFCC=H[1-6]2/ {lanes=1; pattern=2; next} #/^CFCC=H[1-6][013-9]/ {lanes=1; next} #/^CFCC=H7/ {display_level=0; label_level=0; next} #/^CFCC=H8/ {lanes=1} #/^CFCC=H81/ {color=15; fill_color=15; next} # X00 - feature not yet classified # just a demo of the END_RECORD and END rules: #END_RECORD {name="$name ($key)";} #END {}