Skip to content
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

Declarative constructors in python #459

Closed
artemp opened this issue Oct 11, 2011 · 3 comments
Closed

Declarative constructors in python #459

artemp opened this issue Oct 11, 2011 · 3 comments

Comments

@artemp
Copy link
Member

artemp commented Oct 11, 2011

from: http://lists.berlios.de/pipermail/mapnik-users/2009-April/001877.html

"""
2. Heavier use of keyword args in constructors. I've put all possible
symbolizer parameters for the few that I've made into the
constructors, which removes the situation in the wiki GettingStarted
page where it's necessary to instantiate an object and then perform
further changes to it to get it all working. In particular, it should
be possible to populate a mapnik.Map object with style and layer
information in an entirely declarative fashion, as shown in this test
from cascadenik:
http://code.google.com/p/mapnik-utils/source/browse/branches/cascadenik-xmlbad/test.py#1519
"""

@artemp
Copy link
Member Author

artemp commented Oct 11, 2011

[springmeyer] see also random idea at #319

@artemp
Copy link
Member Author

artemp commented Oct 11, 2011

[mishok13] The code linked here is an example of trying to map XML straight to Python data structures. I have something other on my mind, something like this:

{{{
layer = mapnik.Layer('layername', datasource=some_datasource, srs=some_srs)
layer.symbolizers = [mapnik.SomeSymbolizer(...),
mapnik.AnotherSymbolizer(...)]
layer.style = map_.styles['some_style'] # optionally, 'default' style will be used if not specified
map_.layers.append(layer)
}}}

This code is just a dream, of course. :)

@artemp
Copy link
Member Author

artemp commented Oct 11, 2011

[springmeyer] as far as default styles, I just created #461 which notes some issues around that, which I've been pondering.

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

No branches or pull requests

2 participants