[mapserver-users] can an ogr tileindex refer to a PG table?

Neil Best nbest at lanworth.com
Thu Feb 21 09:54:52 PST 2008


Last fall I got some help for the list on how to use Postgres as a 
source for a tile index that gives locations of raster files on disk and 
that has been working beautifully.

My new question is this:  Is it possible for a tile index location to 
indicate something other than a path to a file, such as a PostGIS table?

The reason that I ask is that I have implemented table partitioning for 
large county-by-county (or smaller) data sets such as SSURGO and USDA 
CLU.  At the outset I convinced myself mistakenly that Postgres could 
leverage spatial check constraints for query planning using the 
constraint_exclusion = on mechanism, but it can't.  It only works with 
fields where the check constraint is based on a straight equal/not-equal 
comparison to a constant, AFAICT.  Neither && ::geometry or ~ ::text 
checks work for this reason.

Getting Mapserver to leverage this advanced query planning means adding 
logic to my application to inject appropriate values into a WHERE clause 
in the layer's DATA query string.  To do this I need some kind of 
generalized layer that indicates the spatial organization of the 
attributes used for the partitioning.  This is essentially a tile index, 
so if I could just create a layer of bounding boxes for each table and 
let Mapserver decide which tables it needs to scan rather than adding 
complexity to my application in order to have the query planner do the 
same thing, that would be ideal.

Anybody have any thoughts or experiences to share?  Thanks.

Neil



More information about the MapServer-users mailing list