# $Id: tgr2shp.dbfawk,v 1.3 2005/01/08 09:19:32 we7u Exp $ # # Copyright (C) 2003-2005 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 is used to display Albuquerque arroyos shapefiles from # www.cabq.gov, after converting them from NM State Plane coordinats to # Lat/Lon # ogr2ogr -s_srs arroyos.prj -t_srs "EPSG:4326" arroyos_ll.shp arroyos.shp # # 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="AB_LENGTH:MAP_:SD_TYPE:SD_PRJNUM:IN_DATE:FM_ELEV:TO_ELEV:SLOPE:MAINTAINED:LINING:BOT_WIDTH:SIDE_SLOPE:CHAN_DEPTH:TOP_THICK:BOT_THICK:TYPE:FLOW:VELOCITY:ARROYONAME:ENABLED:USER_INPUT:OWNER:CulvertSiz:len"; #dbffields is which of the above fields we actually want to look at. # No point reading dbffields that are not looked at further. dbffields="ARROYONAME: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=26; fill_color=26; name=""; filled=0; pattern=0; display_level=0; label_level=0; label_color=32; font_size=1; symbol=""; fill_style=0 } /^ARROYONAME=(.+)$/ {name="$1";next} /^TYPE=0$/ {lanes=1; display_level=64; font_size=1; pattern=1; label_level=16;} /^TYPE=1$/ {lanes=1; display_level=128; font_size=1; label_level=32;} /^TYPE=2$/ {lanes=2; display_level=128; font_size=1; label_level=32;} /^TYPE=3$/ {lanes=3; display_level=1024; font_size=1; label_level=64;} /^TYPE=4$/ {lanes=4; display_level=65536; font_size=2; label_level=128;}