Breaking up shapefiles Re: [Xastir] ESRI shapefiles and dbfawk

James Ewen jewen at shaw.ca
Fri Dec 17 02:42:19 EST 2004


> Done.  Look for the "Tools" section of 
> http://www.swcp.com/~russo/shape_web/
> 
> With these two tools you should be able to extract the freeways with:
> 
>  split_shape_by_attributes ROADSEG freeways NATRDCLASS Freeway
> 
> to get a "freeways.{shp,shx,dbf}" set.

Beauty! I even managed to compile the source into exe files... Even when the
header info wasn't where it was supposed to be! I'm just about an expert
Linux user now!!! 8) 

> You can also create a shapefile that only contains shapes 
> whose bounding box intersects one of your choosing (using the 
> same criterion xastir uses to decide whether to draw a shape 
> based on the current display region).
> 
>   split_shape_by_bbox ROADSEG littlearea -115 -114 48 49
> 
> would give you a 1-degree-square shapefile.

Excellent, I will chop the file up into smaller chunks. I'm going to make
them the same size that the B250K Toporama files are chopped up in.

So, now for the next question... Can I parse out Expressways and Freeways,
and then merge them together? They are both equivalent as far as we are
concerned up here. It all depended on what the data entry person was
thinking. A couple highways have chunks missing in the middle because the
attribute changes from expressway to freeway, and back.

In the full file, I set both freeways and expressways up to display the same
way. I'd like to pull both out into one file. Perhaps even reclassify them
all to freeway.

Another way that I was thinking about cutting the province up was into
counties. I'd need to find shapefiles for the county outlines first, but
would it be possible to parse out data within the outline of the counties?
If not, the squares will work good enough!

James
VE6SRV

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.5.4 - Release Date: 12/15/2004
 




More information about the Xastir mailing list