[Mapserver-dev] Extents for layers

Howard Butler hobu at iastate.edu
Tue Jul 27 18:26:48 EDT 2004


List,

I started working on an enhancement to layerObj to allow it to have its 
extent set through the mapfile.  Some more background on this is given in 
bugzilla at http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=786 .

Here is a short synopsis of what I did (with the help of Sean and Frank on 
IRC):
- Modified mapfile.c so that it will capture an EXTENT object when it sees 
it in a LAYER block
- Created a new function - msRectIsValid - in mapsearch.c (where other 
Rect-related functions seem to be) that tests if an extent is valid.
- Added the msRectIsValid prototype to map.h
- Used msRectIsValid to check all of the extents that are taken in in 
mapfile.c (web, map, reference, layer). MapServer now complains if you give 
it an invalid extent.
- Made sure that copyLayer copies the rectObj in mapcopy.c
- Updated msMapSetExtent in mapobject.c to use msRectIsValid

These changes are still in my sandbox and have not yet been committed.  I'm 
still pretty new to MapServer development, and I would like to get approval 
and give people a heads-up before committing something this widespread.

I would eventually like to use this to prevent the opening and getExtent 
requests that can happen to things like OGR, SDE, and PostGIS? layers.  If 
we can give a hint through the mapfile, we can save connection calls and 
query time in certain situations.  Also, the w*s layers might benefit from 
this as well.  If they have an EXTENT set, the w*s_extent could be picked 
up automatically from it.

Please let me know what you think. I also would like to know of places that 
I missed that could benefit from msRectIsValid.

Howard




More information about the mapserver-dev mailing list