[Gdal-dev] Shapefile spatial indexing

Frank Warmerdam warmerdam at pobox.com
Mon Jan 3 23:17:52 EST 2005


Folks,

I think I mentioned in the past that I was looking at implementing spatial
indexing support for the OGR Shapefile driver.  Martin Chapman (and SANZ)
have encouraged me to complete that work and it is now all in CVS.

It is implemented using the same quadtree style format (.qix) used by
UMN MapServer.  Indexes can be created and dropped with pseudo-SQL commands
as noted in the updated shapefile driver document at:

   http://gdal.maptools.org/ogr/drv_shapefile.html

With the spatial index build for a 400MB 900000 feature line file (roads
in Virginia) I was able to read back a 77000 feature subset in 5s as opposed
to 64s without the spatial index.  I was able to read back a 1300 feature
subset in 0.4s compared to 60s.  So the spatial index does give massive
improvements for reading small spatial regions out of large datasets.

If anyone tries out the new capability and runs into problems, please let me
know.

Thanks to SANZ for funding this work, and Steve Lime for his implementation
in MapServer!

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list