[OSM-dev] generate_xml.py not generating osm.xml file?

Lennard ldp at xs4all.nl
Sun Aug 29 13:12:40 BST 2010


On 29-8-2010 11:20, Ákos Maróy wrote:

> what I'm trying to achieve is to include my own<Style>  and<Layer>
> element in the osm.xml file. my hope was that if I create an
> inc/layer-foo.xml.inc file with my<Style>  and<Layer>  definition (just
> like the others there), and list my .xml.inc in inc/layers.xml.inc, than
> my stuff would be included, just as the others.

They are dynamically included, by putting the relevant &layer-xxx; 
references at the right spot in osm.xml. The ordering of <Layer> 
elements in the stylesheet determines the order in which mapnik renders.

So water, for instance, is loaded by way of osm.xml including 
inc/layers.xml.inc, then including any file defined there, and then it's 
actually 'activated' by encountering &layer-water; in osm.xml itself. 
You may have missed that last bit.

> but, it seems osm.xml already has the contents the 'stock' xml.inc files
> literally included. what I was looking for is a way to re-create osm.xml
> with the updated inc/layers.xml.inc, so that my stuff would be included too.

The normal osm.xml file on SVN does not have the xml.inc files included. 
They are dynamically loaded by libxml2 during parsing of osm.xml.

They would only be included in a stylesheet if you tell generate_xml.py 
to create a new stylesheet from osm.xml. You would also loose the 
ability to do a simple svn up to keep in sync with osm.org, as you would 
then also have to rerun generate_xml.py to recreate your local 
stylesheet, after every svn update.

-- 
Lennard




More information about the dev mailing list