Ticket #3043 (closed enhancement: fixed)

Opened 3 years ago

Last modified 7 weeks ago

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

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

Change History

Changed 3 years ago by pramsey

  • owner changed from sdlime to pramsey

Changed 3 years ago by pramsey

First cut of an extent checker.

Changed 3 years ago by pramsey

Applied to trunk at r9083.

Changed 3 years ago by pramsey

  • status changed from new to closed
  • resolution set to fixed

Changed 7 weeks ago by mko

  • cc mko added

See #4126 for some enhancements.

Note: See TracTickets for help on using tickets.