[Xastir] ESRI shapefiles

Tom Russo russo at bogodyn.org
Tue Dec 14 01:47:11 EST 2004


On Mon, Dec 13, 2004 at 08:32:14PM -0800, we recorded a bogon-computron collision of the <archer at eskimo.com> flavor, containing:
> On Mon, 13 Dec 2004, James Ewen wrote:
> 
> > One thing that I'd like to do for Xastir is pull the data apart into various
> > layers. Right now, I get every road in Alberta drawn when zoomed out. I'd
> > like to pull only major highways into a map, the next map would have
> > secondary roads, and the close in layer would have all the local roads.
> 
> If you could easily do that, you'd have the fastest map system that
> you could do with Xastir currently.
> 
> You wouldn't have to read and skip those features that you weren't
> intending to draw.
> 
> Perhaps Tom might have a clue as to whether this could be done
> easily.  

I can't think of an *easy* way.    I do, however, know it can be done 
by pulling the shapefile into a Grass5.7 vector layer, using "v.extract" 
and an SQL-style query to extract only features that match a certain set
of criteria, then exporting the resulting new vector layer to shapefile.

That takes more to describe than to actually execute.  If you disregard the
effort required to install Grass, of course.

Gonna have to play with that idea. 

>I haven't tried that.  You might be able to easily create
> some tools using ogr2ogr or shapelib to do it.

One could certainly make a one-time hack that read in a shapefile
and exported subsets of data based on the contents of DBF records.

But if the goal is only to filter out low-level detail at high zoom levels,
cobbling together a dbfawk file and enabling map levels is less work.  But
certainly *much* slower to execute than the dissected maps James describes.
It could definitely be worth the effort to produce such things.

-- 
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/
 "That which does not kill me is better than that which does."
    --Irving Nietzche, lesser known of the famous Nietzche twins



More information about the Xastir mailing list