Re: [OSM-talk] simplifying mapnik layout definition
* Andreas Barth ([EMAIL PROTECTED]) [080527 23:40]: I have now put a bit of that stuff together. All files (including sample code) is at http://alius.ayous.org/~aba/osm-formater-1/ As I didn't get any comments, I assume that this solution doesn't fit the needs and I'll not follow it further. Cheers, Andi ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
Re: [OSM-talk] simplifying mapnik layout definition
What about using the Python bindings and actual Mapnik objects to create the XML file? It should be able to save an XML file, and that way you can abstract out all of the XML text from your program too... Beau On Wed, May 28, 2008 at 3:05 AM, Steve Hill [EMAIL PROTECTED] wrote: On Tue, 27 May 2008, Andy Allan wrote: Now, if someone is volunteering to make a concise definition format that can be pre-processed into the mapnik XML format (or mapnik python code, or even just read by a modified mapnik directly, or whatever) then I'd absolutely love to SEE THE WORKING CODE. That osm.xml is an unwieldy beast isn't in question, nor are the myriad of possibilities to improve it - what is lacking is working alternative. For OpenPisteMap I create the XML using some PHP code: https://public.subversion.nexusuk.org/trac/browser/openpistemap/trunk/scripts/mktemplate.php I've not converted the entire XML file yet, and I don't pretend it is a universal solution, but I find it easier to work with than the raw MapNik XML file. It would be nice to have some kind of cascading language so that styles can be defined for each object at the top level and then modified for each zoom level, but I suspect no one has the time to do it (I certainly don't). - Steve xmpp:[EMAIL PROTECTED] [EMAIL PROTECTED] sip:[EMAIL PROTECTED] [EMAIL PROTECTED] http://www.nexusuk.org/ Servatis a periculum, servatis a maleficum - Whisper, Evanescence ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
Re: [OSM-talk] simplifying mapnik layout definition
On Tue, 27 May 2008, Andy Allan wrote: Now, if someone is volunteering to make a concise definition format that can be pre-processed into the mapnik XML format (or mapnik python code, or even just read by a modified mapnik directly, or whatever) then I'd absolutely love to SEE THE WORKING CODE. That osm.xml is an unwieldy beast isn't in question, nor are the myriad of possibilities to improve it - what is lacking is working alternative. For OpenPisteMap I create the XML using some PHP code: https://public.subversion.nexusuk.org/trac/browser/openpistemap/trunk/scripts/mktemplate.php I've not converted the entire XML file yet, and I don't pretend it is a universal solution, but I find it easier to work with than the raw MapNik XML file. It would be nice to have some kind of cascading language so that styles can be defined for each object at the top level and then modified for each zoom level, but I suspect no one has the time to do it (I certainly don't). - Steve xmpp:[EMAIL PROTECTED] sip:[EMAIL PROTECTED] http://www.nexusuk.org/ Servatis a periculum, servatis a maleficum - Whisper, Evanescence ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
Re: [OSM-talk] simplifying mapnik layout definition
On 27 May 2008, at 18:29, Robert (Jamie) Munro wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andy Allan wrote: | Now, if someone is volunteering to make a concise definition format | that can be pre-processed into the mapnik XML format (or mapnik python | code, or even just read by a modified mapnik directly, or whatever) | then I'd absolutely love to SEE THE WORKING CODE. That osm.xml is an | unwieldy beast isn't in question, nor are the myriad of possibilities | to improve it - what is lacking is working alternative. IMHO in this case, the code is the easy part - it's designing a good Ah, we just have to solve the much smaller problem - the definition of 'good'. Best Steve ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
Re: [OSM-talk] simplifying mapnik layout definition
* Robert (Jamie) Munro ([EMAIL PROTECTED]) [080527 20:07]: If we can agree some basic ideas for how the format should work, and what won't work, someone may come along and try to implement it. If you just say go away until you have finished the whole thing every time, it's not surprising people don't write anything because they have no idea where to start. You seem to read different mails than I do. I read the mails from Andy (and others) as looks great, next step is actually working on code. Which is what I do now. (And that definitly won't be the last round of code, it's just a beginning.) Cheers, Andi -- http://home.arcor.de/andreas-barth/ ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
Re: [OSM-talk] simplifying mapnik layout definition
* Andreas Barth ([EMAIL PROTECTED]) [080527 16:45]: [...] I have now put a bit of that stuff together. All files (including sample code) is at http://alius.ayous.org/~aba/osm-formater-1/ I re-formated the road-sections. They now look like this: !-- PRIMARY-- RuleMulti Filter[highway] = 'primary' or [highway] = 'primary_link'/Filter LineParam name=stroke#e46d71/LineParam Scale min=200 max=500LineParam name=stroke-width0.7/LineParam/Scale Scale min=50 max=200LineParam name=stroke-width1.6/LineParam/Scale Scale min=20 max=50LineParam name=stroke-width2.5/LineParam/Scale /RuleMulti 3template.py is the actual python code osm-template-reformated.xml is the result of the operation osm-template.xml the original file I used osmshort.xml is the new source file I know that the python code isn't final yet, and also that there are few spaces too much in the resulting xml file. If the trend however looks ok, I'd continue reformating the sections in that way (railways need to swap places, so I didn't do that yet), and adding code for other cases. (And as said before, I'm quite sure that after the first reformating round, there'll be a second one where we learned much from the first one.) Cheers, Andi -- http://home.arcor.de/andreas-barth/ ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
Re: [OSM-talk] simplifying mapnik layout definition
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andreas Barth wrote: | * Dave Stubbs ([EMAIL PROTECTED]) [080527 18:01]: | I don't think inferring the LineSymbolizer is a good idea. But if you | want to write a preprocessor to do the scale extraction I think that | might help a lot. | | ok - though it might happen I'll fiddle with it anyways for start. Let's | see ... | | | Personally I'd like to see an end to the XML syntax as it's hard to | read, but that's more work than it's worth right now (to me at least). | | Any better idea than xml in your mind? Going away from XML might be an | option, but none I'll probably start with (simply for the ease of | getting started). How about YAML? You could either write a script to convert YAML to XML, and use the XML as normal, or possibly you could write a python script that read the YAML and built the styles in mapnik directly as in: http://trac.mapnik.org/wiki/GettingStarted PyYAML (http://pyyaml.org/wiki/PyYAML) is really simple to use. You feed it python lists and dictionaries containing each other, and it outputs YAML code, which is easy to read and easy to edit as long as you are careful with the whitespace (like python). Feed it YAML code and it returns lists and dictionaries. Robert (Jamie) Munro -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkg8nTUACgkQz+aYVHdncI29mgCgrD/zYFV0lX3PYTIDgNYXP01P AqsAn2NoU5OqWFbwpuQ7tG4rkzdFJhrw =FDPf -END PGP SIGNATURE- ___ talk mailing list talk@openstreetmap.org http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk