Opened 15 years ago

Closed 15 years ago

Last modified 12 years ago

#3043 closed enhancement (fixed)

Layer processing shortcut using LAYER.EXTENT

Reported by: pramsey Owned by: pramsey
Priority: normal Milestone: 6.0 release
Component: MapServer C Library Version: svn-trunk (development)
Severity: normal Keywords: layer extent
Cc: mko

Description

The LAYER.EXTENT can be used to quickly discard a layer for processing early in the map draw cycle. Right now, msLayerIsVisible() only tests for things like scales and on/off/default, it doesn't check to see if map extent intersects layer extent. The overhead is fairly small, but on extremely large map files, does in fact add up to non-trivial wait times (2s for a 500 layer map file with all layers STATUS ON).

The development approach will add a shortcut into msLayerIsVisible() that will only be called in the case where LAYER.EXTENT is set to a non-default value (the default is -1,-1,-1,-1). The LAYER.EXTENT will be assumed to be coordinates that match LAYER.PROJECTION (or MAP.PROJECTION, if LAYER.PROJECTION is not set (or MAP.EXTENT if MAP.PROJECTION is also not set)).

Ideally, the comparison between MAP.EXTENT and LAYER.EXTENT would take place in geographics, to avoid the expense of using msProjectRect to push rectangles into potentially impossible comparison projections (ie pulling a LAYER extent in UTM2 into a MAP extent in UTM30). However, for this to be efficient, we need a projectionObj in the mapObj context, and fortunately the mapObj->latlon object exists for us!

Attachments (1)

layerextentcheck1.patch (3.8 KB ) - added by pramsey 15 years ago.
First cut of an extent checker.

Download all attachments as: .zip

Change History (5)

comment:1 by pramsey, 15 years ago

Owner: changed from sdlime to pramsey

by pramsey, 15 years ago

Attachment: layerextentcheck1.patch added

First cut of an extent checker.

comment:2 by pramsey, 15 years ago

Applied to trunk at r9083.

comment:3 by pramsey, 15 years ago

Resolution: fixed
Status: newclosed

comment:4 by mko, 12 years ago

Cc: mko added

See #4126 for some enhancements.

Note: See TracTickets for help on using tickets.