You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use the python bindings to style text. To do that, I define a TextSymbolizer and I try to set its name property. However, when I do this, I get this expection:
Traceback (most recent call last):
File "bug.py", line 4, in <module>
text_symbolizer.name = mapnik.Expression('[name]')
File "/usr/lib64/python3.4/site-packages/mapnik/__init__.py", line 824, in name
self.properties.format_tree = FormattingText(name)
NameError: name 'FormattingText' is not defined
From what I see in mapnik_text_placement.cpp the code that provides this functionality is commented. If I try to uncomment the code, python-mapnik doesn't compile.
which says something about the symbolizers being represented differently in python somehow... and that we should be using the "XML styling interface"
We're still looking into what exactly the "XML styling interface" is. 😠
edit: oh wait. oh wait oh wait oh wait.
It's reading the XML file. instead of creating objects you just read in an XML file, if you want to do it dynamically you write to an XML file then read it via mapnik. OK. I think I see.
It's reading the XML file. instead of creating objects you just read in an XML file, if you want to do it dynamically you write to an XML file then read it via mapnik.
That's how I made text symbolizers work. Took me a while to figure out though.
Activity
Ghoughpteighbteau commentedon Sep 6, 2016
It seems like TextSymbolizer has become deprecated? We've been doing some forensics trying to figure out what's going on.
The last thing to touch the commented out code referenced this issue in mapnik mapnik/mapnik#2324
Which leads to here: #7
which says something about the symbolizers being represented differently in python somehow... and that we should be using the "XML styling interface"
We're still looking into what exactly the "XML styling interface" is. 😠
edit: oh wait. oh wait oh wait oh wait.
It's reading the XML file. instead of creating objects you just read in an XML file, if you want to do it dynamically you write to an XML file then read it via mapnik. OK. I think I see.
Jenselme commentedon Sep 7, 2016
That's how I made text symbolizers work. Took me a while to figure out though.