-
Notifications
You must be signed in to change notification settings - Fork 826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow late-binding of datasources #622
Comments
[gravitystorm] This would massively help with large-raster data sources. At the moment if a raster is greater than 512*512 ( http://trac.mapnik.org/browser/trunk/plugins/input/raster/raster_datasource.cpp#L135 ) there is significant overhead in pre-processing - leading to >15 minutes mapnik-startup times when using >10,000 raster layers. Deferring this processing to when the raster is actually needed would be great. |
[rcoup] Plan is to port to 0.7.x branch after committed to trunk - the datasource stuff doesn't appear to have changed that much so it shouldn't be too hard. |
[springmeyer] applied to trunk in r2291 and backported to 0.7.2 in r2293 |
see reworking of this at #962 |
Currently when you create a Datasource it immediately (in the constructor) checks to see whether the file/database/table/etc is available.
For cascadenik we now have a compile option which instantiates mapnik objects (including datasources) and then serializes them out to XML. This obviously is a bit annoying if the production DB/data/etc need to be available.
Proposal:
datasource(const mapnik::parameters& params, bool bind=true)
. It will still check for the right parameters (eg.table
parameter for postgis datasource,file
parameter for shape, etc) but NOT attempt to verify that they exist or are accessible.void bind()
method to the datasources which does the same work the constructor used to do - checking files exist, connecting to DBs, sorting out extents, etc. If it's called more than once it no-ops.bind()
would be called by the constructor whenbind=true
(the default), so existing behaviour doesn't change.envelope()
,features()
, andfeatures_at_point()
would all check for bound-ness and call bind() if they're not.bind()
method and thebind
constructor parameter would be exposed through the python bindings.The text was updated successfully, but these errors were encountered: