[Xastir] New capability: 2008 Tiger Shapefile street maps

Tom Russo russo at bogodyn.org
Sun May 3 17:12:16 EDT 2009


On Sun, May 03, 2009 at 03:24:42PM -0400, we recorded a bogon-computron collision of the <mckeehan at mckeehan.homeip.net> flavor, containing:
> I'm not knowledgeable enough about shape files to be able to figure out what
> the "where" clause should be.
> 
> What I would like to do is pull parts of the shape files into their own file,
> so I would have a file (probably still keeping it broken down by state/county)
> for Limited Access Roads, another for secondary roads, etc.; basically, the
> same breakdown that is done in the dbfawk files. Having each bit of
> information in a separate file would let me set the max zoom level for each
> file and thus prevent Xastir from reading data that I have no intention of
> displaying at the particular zoom level that I am at.
> 
> So that's my end goal.
> 
> With that in mind, can someone recommend tools that would help me understand
> how to build appropriate where clauses to break these files out?

K.  I just did this for Santa Fe County, NM, file "tl_2008_35049_edges.shp":

Limited access roads:
  ogr2ogr  -where "MTFCC like 'S11%'" SantaFeLTDAroads.shp tl_2008_35049_edges.shp

Secondary roads:
  ogr2ogr  -where "MTFCC like 'S12%'" SantaFeSecondaryRoads.shp tl_2008_35049_edges.shp

Lather, rinse, repeat for other patterns in the DBFAWK file.

"MTFCC='S11'" didn't work, because it turns out that the actual MTFCC values
*start* with S11, but have suffixes.  So -where "MTFCC like 'S11%'" matches
any record with MTFCC that starts with S11.

That should get you on the path.  HTH.

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236        http://kevan.org/brain.cgi?DDTNM
  In some cultures what I do would be considered normal. 
                                  -- Ineffective daily affirmation 




More information about the Xastir mailing list