mapnik-org/mapnik — Issue #890: Suppress dataset object instantiantion if layer status is off
Author: artemp
Created: 2011-10-11 08:16:27+00:00
State: open
Labels: Core_Library

While working with a mostly PostGIS based style sheet I noticed that data source for layers with status off were still instantiated, resulting in SRID queries to the PostGIS DB.

Since it seems unnecessary to instantiate any data source associated with an off status, I changed map_parser::parse_layer to check layer status before instantiating the data source object

load_map.cpp line 643 now has the try/catch block wrapped with

if( lyr.isActive() )
{
}

While it can be argued that this is bad behavior on the part of the the PostgreSQL driver, it seems that other input drivers could easily perform non-trivial initialization.

If you're interested in integrating this change, please advise and I'll provide a delta.