[Xastir] Re: Tiger 2003 Polygons?

Tom Russo russo at bogodyn.org
Thu Oct 21 04:25:45 EDT 2004


On Wed, Oct 20, 2004 at 01:49:15PM -0700, we recorded a bogon-computron collision of the <archer at eskimo.com> flavor, containing:
> On Wed, 20 Oct 2004, Derrick J Brashear wrote:
> 
> > > I ran it against one county's worth of data as:
> > >
> > >    tigerpoly.py .  tgr53061wat.shp
> > >
> > > Result was that I got a shapefile containing all lines/polygons in
> > > that one shapefile, and it was very big.  I must have done something
> > > wrong.  Just wanted the polygons!  At least it indexes and draws ok,
> > > all in blue (due to the "wat" in the name).
> >
> > If you figure it out I'm willing to reprocess the data; Otherwise, I won't
> > have time till the weekend but I'm willing to poke at it.
> 
> Talking with Tom Russo about it quite a bit, he's of the opinion
> that I got you involved way too early, and I'm now of the same
> opinion.  It looks like that tigerpoly.py script doesn't do what we
> want, but it's at least a good start on the matter.  It'll take some
> more development before we get just want we want out of it.

OK, I think I have a first cut at this.

Attached is "Xastir_tigerpoly.py", a modification of "tigerpoly.py"
that comes with gdal.  It will assemble tiger polygons (all of them),
pulling together all of the data related to them from what OGR calls
"PIP", "Polygon," "AreaLandmarks" and "Landmarks" (and what TIGER
calls "record types P, A, S, 8 and 7").  Also attached is a first cut at a 
dbfawk file for the resulting polygon shapefiles.

To use it:
   Unzip a TIGER/Line zip file into a clean directory.  cd to that directory.
   Xastir_tigerpoly.py . some_shapefile_name.shp
   Go get a cup of coffee.
   Copy some_shapefile_name.{shp,dbf,shx} to your xastir maps directory
   Copy tgr2shppoly.dbfawk to your /usr/local/share/xastir/config/ directory.
   Start Xastir
   Bask in polygonal glow.

I have made *all* of the polygons stippled with this dbfawk file, coz I hate
the look of the solid ones.  Modify to taste.

I am not willing to declare victory just yet, because
  a) I don't actually know python, and the script is just cobbled together
     sorta the way you might expect a monkey to craft its own hammer if it 
     had a flint hammer as a pattern 
  b) The code is inefficient, coz I was just making it up as I went along,
     and store way too many pieces of unnecessary information in hashes
  c) Large areas like big wilderness areas, lakes, military reservations, etc.
     are represented by a LOT of little polygon features in TIGER/Line data.
     When that happens, each little polygon gets a landmark name, not just the
     big one.  For some areas that is really ugly.
  d) It's 2:30 in the morning, and I just stopped tweaking the dbfawk file
     when I got to this point.  There are many things that don't look quite
     right.

I mail it anyway, because you can have tiger shapefile conversions of polygon
features now.

-- 
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/
(1) Ignorance of your profession is best concealed by solemnity and silence,
which pass for profound knowledge upon the generality of mankind.
                -------"Advice to Officers of the British Army", 1783
-------------- next part --------------
#!/usr/bin/env python
###############################################################################
# $Id$
# Modified version of GDAL/OGR "tigerpoly.py" script (as described below)
# adapted to assemble information from more tables of the TIGER/Line data
# than had been done by the original
###############################################################################
# 
# Adapted for Xastir use by Tom Russo
#
####################Original comments follow
###############################################################################
# tigerpoly.py,v 1.3 2003/07/11 14:52:13 warmerda Exp 
#
# Project:  OGR Python samples
# Purpose:  Assemble TIGER Polygons.
# Author:   Frank Warmerdam, warmerdam at pobox.com
#
###############################################################################
# Copyright (c) 2003, Frank Warmerdam <warmerdam at pobox.com>
# 
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
###############################################################################


import osr
import ogr
import string
import sys

#############################################################################
class Module:

    def __init__( self ):
        self.lines = {}
        self.poly_line_links = {}

#############################################################################
# I dunno, does this initializer make sense?
class Field:
    def __init__( self ):
        self.layer = ''
        self.layerName = ''
        self.field_defn = ''
        self.fld_index = ''

#############################################################################
def Usage():
    print 'Usage: tigerpoly.py infile [outfile].shp'
    print
    sys.exit(1)

#############################################################################
# Argument processing.

infile = None
outfile = None

i = 1
while i < len(sys.argv):
    arg = sys.argv[i]

    if infile is None:
	infile = arg

    elif outfile is None:
	outfile = arg

    else:
	Usage()

    i = i + 1

if outfile is None:
    outfile = 'poly.shp'

if infile is None:
    Usage()

#############################################################################
# Open the datasource to operate on.

ds = ogr.Open( infile, update = 0 )

poly_layer = ds.GetLayerByName( 'Polygon' )
pip_layer = ds.GetLayerByName( 'PIP' )
areaLandmarks_layer = ds.GetLayerByName( 'AreaLandmarks' )
Landmarks_layer = ds.GetLayerByName( 'Landmarks' )

#############################################################################
#	Create output file for the composed polygons.

shp_driver = ogr.GetDriverByName( 'ESRI Shapefile' )
shp_driver.DeleteDataSource( outfile )

shp_ds = shp_driver.CreateDataSource( outfile )

shp_layer = shp_ds.CreateLayer( 'out', geom_type = ogr.wkbPolygon )

# Now create a list of all the fields for the DBF file, using the unique
# fields in Polygon, PIP, AreaLandmarks and Landmarks --- eliminate
# all fields of identical names (because those are just the fields that
# link the records to each other).  When we do so, must store layer, field
# index in the hash, and we'll write it back by 

# Create a hash of field definitions indexed by field name.
fields_hash = {}
field_names = []

src_defn = poly_layer.GetLayerDefn()
poly_field_count = src_defn.GetFieldCount()

for fld_index in range(poly_field_count):
    src_fd = src_defn.GetFieldDefn( fld_index )
    fields_hash[src_fd.GetName()] = Field()
    fields_hash[src_fd.GetName()].layer=poly_layer
    fields_hash[src_fd.GetName()].layerName='Polygon'
    fields_hash[src_fd.GetName()].field_defn=src_defn
    fields_hash[src_fd.GetName()].fld_index=fld_index
    field_names.append(src_fd.GetName())
#    print 'Got a Polygon field called %s' % src_fd.GetName()


# now loop over other layers
src_defn = pip_layer.GetLayerDefn()
pip_field_count = src_defn.GetFieldCount()
for fld_index in range(pip_field_count):
    src_fd = src_defn.GetFieldDefn( fld_index )
    try:
      foo = fields_hash[src_fd.GetName()]
#      print ' found pip field %s already in hash' % src_fd.GetName()
    except:
      field=Field()
      fields_hash[src_fd.GetName()] = field
      fields_hash[src_fd.GetName()].layer=pip_layer
      fields_hash[src_fd.GetName()].layerName='PIP'
      fields_hash[src_fd.GetName()].field_defn=src_defn
      fields_hash[src_fd.GetName()].fld_index=fld_index
      field_names.append(src_fd.GetName())
#      print 'Got a pip field called %s' % src_fd.GetName()            

src_defn = areaLandmarks_layer.GetLayerDefn()
areaLandmarks_field_count = src_defn.GetFieldCount()
for fld_index in range(areaLandmarks_field_count):
    src_fd = src_defn.GetFieldDefn( fld_index )
    try:
      foo = fields_hash[src_fd.GetName()]
#      print ' found areaLandmarks field %s already in hash' % src_fd.GetName()
    except:
      field=Field()
      fields_hash[src_fd.GetName()] = field
      fields_hash[src_fd.GetName()].layer=areaLandmarks_layer
      fields_hash[src_fd.GetName()].layerName='AreaLandmarks'
      fields_hash[src_fd.GetName()].field_defn=src_defn
      fields_hash[src_fd.GetName()].fld_index=fld_index
      field_names.append(src_fd.GetName())
#      print 'Got a areaLandmarks field called %s' % src_fd.GetName()            
src_defn = Landmarks_layer.GetLayerDefn()
Landmarks_field_count = src_defn.GetFieldCount()
for fld_index in range(Landmarks_field_count):
    src_fd = src_defn.GetFieldDefn( fld_index )
    try:
      foo = fields_hash[src_fd.GetName()]
#      print ' found Landmarks field %s already in hash' % src_fd.GetName()
    except:
      field=Field()
      fields_hash[src_fd.GetName()] = field
      fields_hash[src_fd.GetName()].layer=Landmarks_layer
      fields_hash[src_fd.GetName()].layerName='Landmarks'
      fields_hash[src_fd.GetName()].field_defn=src_defn
      fields_hash[src_fd.GetName()].fld_index=fld_index
      field_names.append(src_fd.GetName())
#      print 'Got a Landmarks field called %s' % src_fd.GetName()            

# we now have a hash whose keys are all our field names, and from which
# we *should* be able to retreive fields as needed
#print ' we found %d fields' % len(fields_hash)
#print ' the names array has %d names ' % len(field_names)
#for field_name in (field_names):
#  print ' key %s we get field from %s ' % (field_name ,fields_hash[field_name].layerName)

# Now loop over all those field names, create the dbf file definition

for field_name in (field_names):
  src_defn = fields_hash[field_name].field_defn
  src_fd = src_defn.GetFieldDefn( fields_hash[field_name].fld_index )
  fd = ogr.FieldDefn( src_fd.GetName(), src_fd.GetType() )
  fd.SetWidth( src_fd.GetWidth() )
  fd.SetPrecision( src_fd.GetPrecision() )
  shp_layer.CreateField(fd)

#############################################################################
# Read all features in the line layer, holding just the geometry in a hash
# for fast lookup by TLID.

line_layer = ds.GetLayerByName( 'CompleteChain' )
line_count = 0

modules_hash = {}

feat = line_layer.GetNextFeature()
geom_id_field = feat.GetFieldIndex( 'TLID' )
tile_ref_field = feat.GetFieldIndex( 'MODULE' )
while feat is not None:
    geom_id = feat.GetField( geom_id_field )
    tile_ref = feat.GetField( tile_ref_field )

    try:
        module = modules_hash[tile_ref]
    except:
        module = Module()
        modules_hash[tile_ref] = module

    module.lines[geom_id] = feat.GetGeometryRef().Clone()
    line_count = line_count + 1

    feat.Destroy()

    feat = line_layer.GetNextFeature()

print 'Got %d lines in %d modules.' % (line_count,len(modules_hash))

#############################################################################
# Read all polygon/chain links and build a hash keyed by POLY_ID listing
# the chains (by TLID) attached to it. 

link_layer = ds.GetLayerByName( 'PolyChainLink' )

feat = link_layer.GetNextFeature()
geom_id_field = feat.GetFieldIndex( 'TLID' )
tile_ref_field = feat.GetFieldIndex( 'MODULE' )
lpoly_field = feat.GetFieldIndex( 'POLYIDL' )
rpoly_field = feat.GetFieldIndex( 'POLYIDR' )

link_count = 0

while feat is not None:
    module = modules_hash[feat.GetField( tile_ref_field )]

    tlid = feat.GetField( geom_id_field )

    lpoly_id = feat.GetField( lpoly_field )
    rpoly_id = feat.GetField( rpoly_field )

    try:
        module.poly_line_links[lpoly_id].append( tlid )
    except:
        module.poly_line_links[lpoly_id] = [ tlid ]

    try:
        module.poly_line_links[rpoly_id].append( tlid )
    except:
        module.poly_line_links[rpoly_id] = [ tlid ]

    link_count = link_count + 1

    feat.Destroy()

    feat = link_layer.GetNextFeature()

print 'Processed %d links.' % link_count

# Now we need to pull in all the PIP, AreaLandmarks and Landmarks features
# and keep them in a hash based on POLYID

#PIP:
feat = pip_layer.GetNextFeature()
polyid_field = feat.GetFieldIndex( 'POLYID' )
pip_hash={}

while feat is not None:
   poly_id = feat.GetField( polyid_field )
   pip_hash[poly_id] = feat
   feat = pip_layer.GetNextFeature()   

print 'Processed %d PIP records.' % len(pip_hash)

#AreaLandmarks
feat = areaLandmarks_layer.GetNextFeature()
polyid_field = feat.GetFieldIndex( 'POLYID' )
areaLandmarks_hash={}

while feat is not None:
   poly_id = feat.GetField( polyid_field )
   areaLandmarks_hash[poly_id] = feat
   feat = areaLandmarks_layer.GetNextFeature()   
print 'Processed %d AreaLandmarks records.' % len(areaLandmarks_hash)


# Landmarks is not looked up by polyid, but by LAND, which links it to 
# Landmarks
feat = Landmarks_layer.GetNextFeature()
land_field = feat.GetFieldIndex( 'LAND' )
Landmarks_hash={}

while feat is not None:
   land_id = feat.GetField( land_field )
   Landmarks_hash[land_id] = feat
   feat = Landmarks_layer.GetNextFeature()   
print 'Processed %d Landmarks records.' % len(Landmarks_hash)


# Boy, what a mess.  But we now have all the data we need in hashes, so we
# can loop over POLYGON records and extract data as we need it.
# Do that now:
#############################################################################
# Process all polygon features.

feat = poly_layer.GetNextFeature()
tile_ref_field = feat.GetFieldIndex( 'MODULE' )
polyid_field = feat.GetFieldIndex( 'POLYID' )

poly_count = 0

while feat is not None:
    module = modules_hash[feat.GetField( tile_ref_field )]
    polyid = feat.GetField( polyid_field )

    tlid_list = module.poly_line_links[polyid]

    link_coll = ogr.Geometry( type = ogr.wkbGeometryCollection )
    for tlid in tlid_list:
        geom = module.lines[tlid]
        link_coll.AddGeometry( geom )

    try:
        poly = ogr.BuildPolygonFromEdges( link_coll )

        #print poly.ExportToWkt()
        #feat.SetGeometryDirectly( poly )

        feat2 = ogr.Feature(feature_def=shp_layer.GetLayerDefn())

        for fld_index in range(len(field_names)):
           theFieldName = field_names[fld_index]
           layerName = fields_hash[theFieldName].layerName
           theFieldIdx = fields_hash[theFieldName].fld_index
#           print 'fetching field %s from layer %s' % (theFieldName, layerName)
           # if it's from Polygon just pop it in because we have it now:
           if layerName == 'Polygon':
              feat2.SetField( fld_index, feat.GetField(theFieldIdx) )
           # If it's from PIP, we definitely have one
           elif layerName == 'PIP':
              feat2.SetField(fld_index, pip_hash[polyid].GetField(theFieldIdx))
           # this could be a problem, coz there might not be one
           elif layerName == 'AreaLandmarks':
              try:
                feat3 = areaLandmarks_hash[polyid]
#                print ' found feature with polyid %d in AreaLandmarks' % polyid
                feat2.SetField(fld_index, feat3.GetField(theFieldIdx))
              except:
                feat2.UnsetField(fld_index)
           # this one's mega tricky, coz it depends on there being
           # an AreaLandmarks first
           elif layerName == 'Landmarks':
              try:
                feat3 = areaLandmarks_hash[polyid]
#                print ' found feature with polyid %d in AreaLandmarks' % polyid
                landidx1 = feat3.GetFieldIndex('LAND')
#                print '  LAND is field %d in AreaLandmarks' % landidx1
#                print '   LAND field in this record is %d.' % feat3.GetField(landidx1)
                feat4 = Landmarks_hash[feat3.GetField(landidx1)]
#                print ' found feature with LAND %d in Landmarks' % feat3.GetField(landidx1)
                feat2.SetField(fld_index, feat4.GetField(theFieldIdx))
              except:
                feat2.UnsetField(fld_index)
           else:
              print 'unknown layer %s referenced.' % layerName

        feat2.SetGeometryDirectly( poly )

        shp_layer.CreateFeature( feat2 )
        feat2.Destroy()

        poly_count = poly_count + 1
    except:
        print 'BuildPolygonFromEdges failed.'

    feat.Destroy()

    feat = poly_layer.GetNextFeature()

print 'Built %d polygons.' % poly_count
           

#############################################################################
# Cleanup

shp_ds.Destroy()
ds.Destroy()
-------------- next part --------------
# $Id$
#
# Copyright (C) 2003-2004  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  shapefiles which are
# converted to shapefiles using the Xastir_tigerpoly.py utility

# BEGIN is called once per dbf file which contains multiple records.
BEGIN {
dbfinfo="MODULE:FILE:CENID:POLYID:STATECU:COUNTYCU:TRACT:BLOCK:BLOCKSUFCU:RS_A1:AIANHHFPCU:AIANHHCU:AIHHTLICU:ANRCCU:AITSCECU:AITSCU:CONCITCU:COUSUBCU:SUBMCDCU:PLACECU:SDELMCU:SDSECCU:SDUNICU:RS_A20:RS_A21:RS_A22:CDCU:ZCTA5CU:ZCTA3CU:RS_A4:RS_A5:RS_A6:RS_A7:RS_A8:RS_A9:CBSACU:CSACU:NECTACU:CNECTACU:METDIVCU:NECTADIVCU:RS_A14:RS_A15:RS_A16:RS_A17:RS_A18:RS_A19:STATE:COUNTY:BLKGRP:AIANHHFP:AIANHH:AIHHTLI:ANRC:AITSCE:AITS:CONCIT:COUSUB:SUBMCD:PLACE:SDELM:SDSEC:SDUNI:MSACMSA:PMSA:NECMA:CD106:CD108:PUMA5:PUMA1:ZCTA5:ZCTA3:TAZ:TAZCOMB:UA:UR:VTD:SLDU:SLDL:UGA:POLYLONG:POLYLAT:WATER:LAND:SOURCE:CFCC:LANAME:LALONG:LALAT:FILLER";
#dbffields is which of the above fields we actually want to look at.
# No point reading dbffields that are not looked at further.
dbffields="WATER:CFCC:LANAME"}

# 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=1; pattern=0; display_level=8192; label_level=32; label_color=8; font_size=0; symbol=""; fill_style=2; fill_stipple=0 }

# Name -- only features that have landmark records get names
/^LANAME=(.*)$/ {name="$1"; next}

# These are *all* the allowed feature classes, even those that aren't
# polygon types.  We won't actually bother testing for anything other 
# than the ones we expect to find, lest we spend too much time filtering.

# Census Feature Class Codes are used to set lanes, color, display_level, etc.
# CFCC A..: roads
# A11 - primary limited access road or interstate highway, unseparated
# A12 - primary limited access road or interstate highway, unseparated in tunnel
# A13 - primary limited access road or interstate highway, unseparated, underpassing
# A14 - primary limited access road or interstate highway, unseparated, with rail line in center
# A15 - primary limited access road or interstate highway, separated
# A16 - primary limited access road or interstate highway, separated, in tunnel
# A17 - primary limited access road or interstate highway, separated, underpassing
# A18 - primary limited access road or interstate highway, separated, with rail line in center
# A21 - primary road without limit access, US highways, unseparated
# A22 -primary road without limit access, US highways, unseparated, in tunnel
# A23 - primary road without limit access, US highways, underpassing
# A24 - primary road without limit access, US highways, unseparated, with rail line in center
# A25 - primary road without limit access, US highways, separated
# A26 - primary road without limit access, US highways, separated, in tunnel
# A27 - primary road without limit access, US highways, separated, underpassing
# A28 - primary road without limit access, US highways, separated, with rail line in center
# A31 - secondary and connection road, state highways, unseperated
# A32 - " in tunnel
# A33 - " underpassing
# A34 - " with rail line in center
# A35 - secondary and connection road, state highways, seperated
# A36 - " in tunnel
# A37 - " underpassing
# A38 - " with rail line in center
# A41 - local, neighborhood and rural road, city street, unseparated
# A42 - " in tunnel
# A43 - " underpassing
# A44 - " with rail line in center
# A45 - local, neighborhood and rural road, city street, separated
# A46 - " in tunnel
# A47 - " underpassing
# A48 - " with rail line in center
# A51 - vehicular trail, unseparated
# A52 - " in tunnel
# A53 - " underpassing
# A61 - cul-de-sac
# A62 - traffic circle
# A63 - access ramp
# A64 - service drive
# A65 - ferry crossing
# A71 - walkway or trail
# A72 - stairway
# A73 - alley
# A74 - driveway

#Roads are not going to be polygons, don't even check

# need to implement these:
# B: railroads
# B01 - railroad track
# B02 - " in tunnel
# B03 - " underpassing
# B11 - railroad main line
# B12 - " in tunnel
# B13 - " underpassing
# B21 - railroad spur
# B22 - " in tunnel
# B23 - " underpassing
# B31 - railroad yard track
# B32 - " in tunnel
# B33 - " underpassing
# B40 - railroad ferry crossing
# B50 - other rail line
# B51 - carline (streetcars, etc.)
# B52 - cog railroad, incline railway or logging tram
# /^CFCC=B/ {lanes=1; color=8; pattern=1; display_level=128; next}

# C: transmission lines
# C00 - misc ground transportation
# C10 - pipeline
# C20 - power transmission line
# C30 - other ground transportation
# C31 - aerial tramway
# /^CFCC=C/ {display_level=0; next}
# D: landmarks
# D00 - unknown
# D10 - military installation
/^CFCC=D1/ { fill_color=0; fill_style=2; fill_stipple=0; display_level=64; font_size=1; next}
# D20 - multihousehold or transient quarters
# D21 - apartment building or complex
# D22 - rooming or boarding house
# D23 - trailer cour or mobile home park
# D24 - marina
# D25 - crew-of-vessel area
# D26 - housing facility for workers
# D27 - hotel, motel, resort, spa, YMCA, YWCA
# D28 - campground
# D29 - shelter or mission
/^CFCC=D2/ { fill_color=14; fill_style=2; fill_stipple=0; display_level=64; font_size=1; next}
# D30 - custodial facility
# D31 - hospital
# D32 - halfway house
# D33 - nursing home
# D34 - county home or poor farm
# D35 - orphanage
# D36 - jail 
# D37 - federal penetentiary, state prison, or prison farm
/^CFCC=D3/ { fill_color=13; fill_style=2; fill_stipple=0; display_level=64; font_size=1; next}
# D40 - unknown educational or religious
# D41 - sorority or fraternity
# D42 - convent or monastery
# D43 - educational institution
# D44 - religious institution
/^CFCC=D4/ { fill_color=20; fill_style=2; fill_stipple=0; display_level=64; font_size=1; next}
# D50 - transportation terminal
# D51 - airport
# D52 - train station
# D53 - bus terminal
# D54 - marine terminal
# D55 - seaplane anchorage
# D57 - Airport
/^CFCC=D5/ { fill_color=7; fill_style=2; fill_stipple=0; display_level=64; font_size=1; next}
# D60 - Employment center
# D61 - Shopping center
# D62 - Industrial Building or Ind. park
# D63 - Office Building or office park
# D64 - Amusement Center
# D65 - Government Center
# D66 - Other emplyoment center
/^CFCC=D6/ { fill_color=7; fill_style=2; fill_stipple=0; display_level=64; font_size=1; next}
# D70 - tower
# D71 - lookout tower
/^CFCC=D7/ { fill_color=7; fill_style=2; fill_stipple=0; display_level=64; font_size=1; next}
# D80 - open space
# D81 - golf course
# D82 - cemetery
# D83 - national park
# D84 - national forest
# D85 - state or local park or forest
/^CFCC=D8/ { fill_color=100; fill_style=2; fill_stipple=0; display_level=64; font_size=1; next}
# D90 - special purpose landmark
# D91 - post office box-only ZIP Code location
# D92 - urbanizacion (Puerto Rico)
/^CFCC=D9/ { fill_color=101; fill_style=2; fill_stipple=0; display_level=64; font_size=1; next}

# E: physical featuers
# E00 - unknown physical feature
# E10 - fence line
# E20 - topgraphic feature
# E21 - ridge line
# E22 - mountain peak
# E23 - island
# Don't display the E's
# F: legal boundaries
# F00 - nonvisible boundary
# F10 - jurisdictional boundary
# F11 - offset boundary
# F12 - corridor boundary
# F13 - interpolate boundary across water
# F14 - superseded boundary
# F15 - superseded boundary, corrected
# F20 - data base topology
# F21 - automated feature extension to lenghten physical feature
# F22 - irregular feature extension, determined manually
# F23 - closure extension
# F24 - separation line
# F25 - centerline
# F30 - point-to-point line
# F40 - property line
# F50 - Zip Code boundary
# F60 - map edge
# F70 - statistical boundardy
# F71 - 1980 "
# F72 - 1990 "
# F73 - internal use
# F74 - 1990 " ...
# F80 - other tabulation boundary
# F81 - internal use
# F82 - internal use
#/^CFCC=F10$/{color=255; fill_color=255; label_level=32; display_level=512; pattern=0; next}
#/^CFCC=F/{display_level=0; next}
# Don't bother with the F's either for now
# (G not used by census;  tig2aprs uses for special maps)
# H: hydrography
/^CFCC=H/ {color=3; fill_color=3; label_color=26; display_level=1;}
# H00 - water feature
# H01 - shoreline of perennial water feature
# H02 - shoreline of intermittent "
/^CFCC=H0/ {fill_style=2; fill_stipple=2; display_level=4096; label_level=16; lanes=1}
/^CFCC=H02/ { fill_stipple=0; pattern=1; next}
# 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
/^CFCC=H[1-5]/ {fill_style=2; fill_stipple=2;display_level=256; label_level=16; lanes=1}
/^CFCC=H[1-4]2/ {fill_stipple=0; pattern=1; next}
# H60 - gravel pit or quarry filled with water
/^CFCC=H6/ {fill_style=2; fill_stipple=2;display_level=256; label_level=16; lanes=1}
# H70 - nonvisibile....
# H80 - special water features
# H81 - glacier
/^CFCC=H81/ {color=15; fill_color=15; fill_style=2; fill_stipple=2;display_level=256; label_level=16; lanes=1}


More information about the Xastir mailing list