Indexed Shapefile vs. PostGIS

Bill Binko bill at BINKO.NET
Wed Aug 24 16:44:15 EDT 2005


On Wed, 24 Aug 2005, Rob McCulley wrote:
> I have a polygon layer with about a million polygons.  The maxscale of the layer will be such that only about two dozen of the polygons will be visible at any one time.  I'm trying to decide on the best method to store this data.  What will be more efficient?
> 
> - Have the polygon layer split into smaller shapefiles and then use an index file.
> 
> - Have the polygon layer in a single table in PostGIS.
> 
> I'm leaning towards the index file setup, but if any of you have experience with large datasets in PostGIS, will it perform as well as using index shapefile?  It will take a lot less work on my part if I can simply import the shapefile into PostGIS.
> 
> Thanks,
> Rob McCulley

I think the big question is are you doing dynamic work with it.

If you're going to be doing analysis or other dynamic stuff ("Find all the
properties bordering this one who's price is < $400K"), you will probably
be better off with PostGIS over tiled shapefiles and OGR (FrankW would
know better on this).

If you're mainly going to be displaying the data, you're almost certainly 
going to be faster with tiled shapefiles.  Also, backup/restore is much 
simpler!

I have found that I must use a hybrid approach.  I have some things that 
are just plain dynamic: I have to use spatial SQL on every display.  For 
these, I use PostGIS.  I also have pure static data, which I leave in 
shapefiles (tiled or not).  When I find that I can, I will use PostGIS to 
do analysis and manipulation to get a dataset that works well.  Then, 
I will export it to shapefiles using psql2shp and just update the map 
file.

Hope this helps.

Bill



More information about the mapserver-users mailing list