1#
2# Copyright (C) 2000-2019 The Xastir Group
3#
4# This dbfawk file is used to map arbitrary dbf data that accompanies
5# a shapefile into Xastir canoncical values of:
6#   key     - search key
7#   lanes   - width of feature (usually a road but applies to rivers, etc. too)
8#   color   - color to draw the road
9#   name    - name of the road for labels
10#   filled  - whether a polygon is drawn filled or not
11#   fill_color - color to fill polygon with
12#   pattern - line pattern for road, river, etc.
13#   display_level - highest zoom level at which to display the feature
14#   label_level - highest zoom level at which to display the label
15#   symbol  - 3 char 'TIO': table, ID, overlay
16#
17# NOTE: This file format is modeled after awk but is nowhere near awk
18#  compatible.
19#
20# This file is used to map US Census Tiger/Line "kgl" (Key Geographic
21# Location) shapefiles which are named tgrSSCCCkgl.dbf, where SSCCC
22# are the FIPS state and county codes.
23
24# BEGIN is called once per dbf file which contains multiple records.
25BEGIN {
26# dbfinfo is the "signature" of the dbf file listing the column names in order.
27# dbfinfo should match the dbf file that we say this dbfawk file goes with.
28dbfinfo="ID:POLYID:COUNTY:CFCC:KGLNAME";
29# dbffields is which of the above fields we actually want to look at.
30dbffields="KGLNAME:CFCC";
31}
32
33# BEGIN_RECORD is called once per dbf record which contains multiple fields.
34# Use this rule to re-initialize variables between records.
35BEGIN_RECORD {key=""; lanes=1; fill_color=255; color=8; name=""; filled=1; pattern=0;
36display_level=0; label_level=0; label_color=8; font_size=2; symbol="/. "}
37
38# name and key are both the KGL name
39/^KGLNAME=(.*)$/ {name=$1; key=$1; next}
40# CFCC=D.. for landmarks.  Use the same code here and for tgrlk.
41#D2: residence?
42#D23: trailer park
43#D28: campground
44/^CFCC=D2/ {symbol="/- "; display_level=64; label_level=32}
45/^CFCC=D23$/ {symbol="/R "; next}
46/^CFCC=D28$/ {symbol="/; "; next}
47/^CFCC=D2/ {next}
48#D31: hospital
49/^CFCC=D31$/ {color=9; symbol="/h "; display_level=128; label_level=64; next}
50#D40: unknown educational or religious
51#D41: sorority or fraternity
52#D42: convent or monastery
53#D43: educational institution
54#D44: religious institution
55/^CFCC=D4/ {color=8; symbol="/K "; display_level=64; label_level=32}
56/^CFCC=D4[03]$/ {color=14; next}
57#D51: airport
58#D54: harbor
59/^CFCC=D51$/ {symbol="/' "; display_level=128; label_level=32; next}
60/^CFCC=D54$/ {symbol="\\s "; display_level=128; label_level=32; next }
61#DB: state forests, etc.
62/^CFCC=D8/ {color=73; display_level=64; label_level=32; next}
63# don't need special end case handling...
64#END_RECORD {}
65#END {}
66