[Xastir] ESRI shapefiles

Curt Mills archer at eskimo.com
Tue Dec 14 02:05:56 EST 2004


On Mon, 13 Dec 2004, James Ewen wrote:

> PalmAPRS maps have zoom level information encoded into them. There's no way
> you can display fine details on a Palm when zoomed out a long way.
>
> There's no reason that this concept has to be limited to the Palm platform.
> In my opinion, all vector maps should have this included in their
> definition.

Sounds great, if you're defining a new map format.  In the case of
Shapefiles, ESRI defined it.  It's missing a few things that I'd
like to see, but overall it's one of the better vector file
definitions (in my opinion).  One of the nicest things about it is
that the bounding rectangle for the entire map is easily readable so
you can skip a map if it doesn't fit your screen, plus it has a
bounding rectangle defined for each shape, so you can do the same
for each shape before getting too far down the path of drawing it.


> With the dbfawk file, I'd assume that all data still needs to be read, to
> determine if it needs to be displayed or not.

Correct.


> Does this speed up the display
> time since it doesn't have to draw the lines?

Yes, but it would be much faster if you weren't even iterating
through the shapes and/or iterating through the dbfawk definitions
for each shape to determine whether to draw.


> My road data for Alberta is 40 MB in size... It takes about 5 seconds to
> draw the map for me. It would be nice to speed that up.

Note that the main body of Xastir went through some profiling a
while back, in order to find the slow sections of code and speed
them up.  The sections for the individual map types still need that
treatment.  That promises to speed things up a bit.

Also, switching to the new hash code might help with the dbfawk
speed, but more work needs to be done to make sure that the hash
code is correct first.  When I last left it, I was under the
impression that a few of the stored hash elements were getting lost.
That code is currently only used for raw Tiger data (TIGER/Line
files) under GDAL/OGR.


> From what I understand of the Xastir map implementation, what I'd need to do
> is:
>
> Make 1 map of Alberta with only the main highways..
> Make a couple maps with secondary highways, splitting the province up into
> say 4 sections.
> Make many maps with street level detail, splitting the sub areas into a
> large number of sections.
>
> Each level of map would then have it's attributes set so that it display at
> appropriate zoom levels. This would allow Xastir to only load the most
> appropriate sections of data, by not only zoom level, but also area to be
> displayed.

Yea, if you split it up into smaller sections it gets much faster as
you're zoomed in, as Xastir doesn't have to look at any of the map
contents.  It just checks the map index (in memory) which has the
bounding rectangle for each map, and skips it if it doesn't fit.

The other place you're speeding things up is by level, where you
don't draw the things you don't want to see at any given level.

Sounds like you're getting the hang of it.

-- 
Curt, WE7U.				archer at eskimo dot com
http://www.eskimo.com/~archer
  Lotto:  A tax on people who are bad at math. - unknown
Windows:  Microsoft's tax on computer illiterates. - WE7U.
The world DOES revolve around me:  I picked the coordinate system!"




More information about the Xastir mailing list