Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Suppress dataset object instantiantion if layer status is off #892

Closed
artemp opened this Issue · 2 comments

2 participants

@artemp
Owner

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.

@artemp
Owner

[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.

@springmeyer springmeyer was assigned
@springmeyer
Owner

done in #153

@springmeyer springmeyer added this to the Mapnik 3.x milestone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.