Suppress dataset object instantiantion if layer status is off #892

Closed
artemp opened this Issue Oct 11, 2011 · 2 comments

Comments

Projects
None yet
2 participants
Owner

artemp commented Oct 11, 2011

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.

Owner

artemp commented Oct 11, 2011

[springmeyer] yes, a simple diff would be great, thanks for the report on this. After you post the diff we'll make sure to take a closer look at this before the 2.0.1 stable release.

@ghost ghost assigned springmeyer Jul 16, 2012

Owner

springmeyer commented Sep 19, 2014

done in #153

@springmeyer springmeyer added this to the Mapnik 3.x milestone Sep 19, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment