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

2010-08-30 Thread Ákos Maróy
Lennard,

 That is correct, also because *you* have to tell mapnik *where* your
 style comes in the whole rendering order, by putting your layer-xxx; at
 the correct spot.

now I see how it works. thank you for the clarification.


Akos

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


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

2010-08-29 Thread Ákos Maróy
Lennard,

 What does happen when you run generate_xml.py is that three files are
 created (or updated) in the inc directory. They are:
 datasource-settings.xml.inc, fontset-settings.xml.inc, settings.xml.inc

thanks for the info - now I see that.

 Some guides still give a syntax like:
 
 generate_xml.py my_osm.xml other stuff
 
 But that's needed only in rare cases where you actually want it to
 create a monolithic copy of the entire mapnik style. my_osm.xml would
 then be composed of osm.xml and all include files from the inc directory.
 
 Normally, you use generate_xml.py to set the contents of the three files
 I mentioned earlier, and then point your map generating script or app to
 osm.xml. Through XML parsing, osm.xml will dynamically include the
 contents of the files in the inc directory.

unfortunately, this does not seem to be the case.

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.

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.

this would be an elegant solution.

now what I'm left with is to manually add my Style and Layer
definition into osm.xml.


Akos

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


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

2010-08-29 Thread Lennard

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


what I'm trying to achieve is to include my ownStyle  andLayer
element in the osm.xml file. my hope was that if I create an
inc/layer-foo.xml.inc file with myStyle  andLayer  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


___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


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

2010-08-29 Thread Ákos Maróy
Lennard,

 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.

what do you mean by 'stylesheet' in this context?

 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.

yes, I see that. but to 'activate' my own layer, I'd still have to
manually edit osm.xml, wouldn't I?

it's actually a pit confusing, that osm.xml both references layers via
these external entities, and contains Layer and Style definitions on
its own.

 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.

I see. the confusion comes from the content of these xml.inc files and
osm.xml in general to be of similar purpose. wonder what make something
get into a layer files, and what is in osm.xml itself.

 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.

yes, I see. my impression was that all of osm.xml is actually generated
from the includes  stuff, and contains no other information.

but, still. it seems that there is no 'simple' or 'elegant' way of just
dropping a new layer-foo.xml.inc file into inc, and to make osm.xml
automatically use the definitions in there. as at least one has to add
an external entity reference manually.

is this correct?


Akos

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


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

2010-08-29 Thread Lennard

On 29-8-2010 14:31, Ákos Maróy wrote:


They are dynamically included, by putting the relevantlayer-xxx;
references at the right spot in osm.xml. The ordering ofLayer
elements in the stylesheet determines the order in which mapnik renders.

what do you mean by 'stylesheet' in this context?


Mapnik uses a stylesheet to tell it what to render and how to render it. 
The OSM stylesheet is called osm.xml and is what I'm referring to.



yes, I see that. but to 'activate' my own layer, I'd still have to
manually edit osm.xml, wouldn't I?


Yes, by referring to your external entity (the xml.inc file) at the 
right place in the osm.xml stylesheet.



it's actually a pit confusing, that osm.xml both references layers via
these external entities, and containsLayer  andStyle  definitions on
its own.


I know. Ideally everything would be found in the xml.inc files, and 
osm.xml would only be a small skeleton file, referring to the include files.



I see. the confusion comes from the content of these xml.inc files and
osm.xml in general to be of similar purpose. wonder what make something
get into a layer files, and what is in osm.xml itself.


When I started to implement the external entities (the include files), I 
took the easy cases and split them off into xml.inc files. Most of what 
remains is so interwoven (all the roads/railways/etc and all the 
bridge/tunnel variants of those) that I left that part alone.



but, still. it seems that there is no 'simple' or 'elegant' way of just
dropping a new layer-foo.xml.inc file into inc, and to make osm.xml
automatically use the definitions in there. as at least one has to add
an external entity reference manually.

is this correct?


That is correct, also because *you* have to tell mapnik *where* your 
style comes in the whole rendering order, by putting your layer-xxx; at 
the correct spot.


--
Lennard


___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


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

2010-08-27 Thread Ákos Maróy
Hi,

Maybe I'm misunderstanding the generic purpose of the generate_xml.py
file from the mapnik rendering toolset, but for me, it does not seem to
touch my osm.xml file in any way.

when I execute generate_xml.py with appropriate database setttings,
osm.xml is not changed in any way. if I remove osm.xml, it is not
generated by the gall to generate_xml.py in any way.

am I misunderstanding that generate_xml.py would actually create osm.xml
based on the contents of the PostGIS database it connects to, and based
on the templates in the inc directory?


Akos

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


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

2010-08-27 Thread Sajjad Anwar
Dear Akos,

I think you have misunderstood the purpose of generate_xml.py
generate_xml.py as far as I understand is to prepare the osm dataset (by
default osm.xml) ready for rendering. It fetches the style sheets, symbol
information etc and modifies the dataset to create the new osm.xml

The README coming with mapnik also explains its use.

Regards.

-- 
Sajjad Anwar | http://geohackers.in | Blog: http://sajjad.in | Twitter:
geohacker
___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


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

2010-08-27 Thread Sajjad Anwar
Taking the freedom to post the email that skipped the list


From: Ákos Maróy a...@maroy.hu
Date: Fri, Aug 27, 2010 at 7:43 PM
Subject: Re: [OSM-dev] generate_xml.py not generating osm.xml file?
To: Sajjad Anwar sajja...@gmail.com


Sajjad,

 I think you have misunderstood the purpose of generate_xml.py
 generate_xml.py as far as I understand is to prepare the osm dataset (by
 default osm.xml) ready for rendering. It fetches the style sheets,
 symbol information etc and modifies the dataset to create the new osm.xml

 The README coming with mapnik also explains its use.

thanks for the answer.

I did read the README file, but this seems to be a catch-22 here. if it
uses osm.xml itself to generate osm.xml - how do you initially create
the first osm.xml, from the style sheets / templates?


Akos

-- 
Sajjad Anwar | http://geohackers.in | Blog: http://sajjad.in | Twitter:
geohacker
___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


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

2010-08-27 Thread Sajjad Anwar
Dear Akos


 I did read the README file, but this seems to be a catch-22 here. if it
 uses osm.xml itself to generate osm.xml - how do you initially create
 the first osm.xml, from the style sheets / templates?

 The osm.xml file is a bit confusing in this scenario. You can see that the
osm.xml file that came along with Mapnik is not the dataset, rather, it
contains certain rules which support the rendering of tiles. You are
actually loading the map data into the pgsql db and asking *
generate_image.py *or*generate_tiles.py *to generate the image or set of
tiles as the case may be.

If you want to make some modifications in the styles and fonts for the
rendering, you could tweak this rule file.
Also note that, Mapnik does not intend you to give the data in xml format,
but it reads the data only from the pgsql database.

The following link contains pointers to setting up Mapnik and basic rules
file modifications
http://sajjad.in/mapping/setting-up-mapnik-for-rendering-tiles-in-your-language/

http://sajjad.in/mapping/setting-up-mapnik-for-rendering-tiles-in-your-language/
Hope
this helps

Cheers
-- 
Sajjad Anwar | http://geohackers.in | Blog: http://sajjad.in | Twitter:
geohacker
___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


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

2010-08-27 Thread Stephan Knauss

Hi,

Sajjad Anwar wrote:
The following link contains pointers to setting up Mapnik and basic 
rules file modifications 
http://sajjad.in/mapping/setting-up-mapnik-for-rendering-tiles-in-your-language/


you can find the trick to render bilingual maps like 
http://thaimap.osm-tools.org/ or http://greece.osm-tools.org/ on my 
download space:


http://downloads.osm-tools.org/bilingual/

I did set up a view to return the matching names from the DB. This is 
also the place you want to edit in case you like a different fallback rule.


Stephan

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


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

2010-08-27 Thread Lennard

On 27-8-2010 15:58, Ákos Maróy wrote:

Hi,

Maybe I'm misunderstanding the generic purpose of the generate_xml.py
file from the mapnik rendering toolset, but for me, it does not seem to
touch my osm.xml file in any way.


That's correct.


when I execute generate_xml.py with appropriate database setttings,
osm.xml is not changed in any way. if I remove osm.xml, it is not
generated by the gall to generate_xml.py in any way.


What does happen when you run generate_xml.py is that three files are 
created (or updated) in the inc directory. They are: 
datasource-settings.xml.inc, fontset-settings.xml.inc, settings.xml.inc


Some guides still give a syntax like:

generate_xml.py my_osm.xml other stuff

But that's needed only in rare cases where you actually want it to 
create a monolithic copy of the entire mapnik style. my_osm.xml would 
then be composed of osm.xml and all include files from the inc directory.


Normally, you use generate_xml.py to set the contents of the three files 
I mentioned earlier, and then point your map generating script or app to 
osm.xml. Through XML parsing, osm.xml will dynamically include the 
contents of the files in the inc directory.


Synching the stylesheet to OSM SVN is then only a matter of running svn 
up. You only need generate_xml.py again if you change any of the 
settings, or if a new setting was introduced (in the .template files in 
the inc directory).



am I misunderstanding that generate_xml.py would actually create osm.xml
based on the contents of the PostGIS database it connects to, and based
on the templates in the inc directory?


osm.xml does not contain geographic data. It contains the stylesheet 
that tells mapnik how to render geo data that you load into the postgis 
db with osm2pgsql.


--
Lennard


___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev