Problem rendering with mapnik

First of all, hi, I am new in this forum, and my name is Jorge. I am doing my final thesis and I have to render some .osm already modified by me.
The thing is that when I tried to generate the final .png I get an error “I/O warning : failed to load external entity “inc/settings.xml.inc”” I have read that this is because I don´t make in the rigth way the step before, “./generate_xml.py -h” but when I do it everything seems ok, because it generates a lot of things and doesn´t say anything is wrong. The full thing that I see when I tried to do it is this:

inc/entities.xml.inc:2: I/O warning : failed to load external entity “inc/settings.xml.inc”
%settings;
^
%settings;
^
I/O warning : failed to load external entity “inc/fontset-settings.xml.inc”
I/O warning : failed to load external entity “inc/datasource-settings.xml.inc”
I/O warning : failed to load external entity “inc/datasource-settings.xml.inc”
I/O warning : failed to load external entity “inc/datasource-settings.xml.inc”
I/O warning : failed to load external entity “inc/datasource-settings.xml.inc”
I/O warning : failed to load external entity “inc/datasource-settings.xml.inc”
I/O warning : failed to load external entity “inc/datasource-settings.xml.inc”
I/O warning : failed to load external entity “inc/datasource-settings.xml.inc”
I/O warning : failed to load external entity “inc/datasource-settings.xml.inc”
I/O warning : failed to load external entity “inc/datasource-settings.xml.inc”
Segmentation fault

I guess this error is normal because when I tried to search for settings.xml.inc I don´t find it, but I don´t know why is not in the inc folder, what should I do? should I create it by my self? Thank you very much in advence, I hope I have explained myself in the right way.

Well, I think is because I don´t included any worldboundaries, so when I tried to make this command:

"./generate_xml.py --host localhost --user whoami --dbname gis --symbols ./symbols/ --world_boundaries ./world_boundaries/ --port 5432 --password ’ ’

I get “generate_xml.py: error: Directory ‘./world_boundaries/’ used for param ‘world_boundaries’ not found”

The thing is that I don´t need those world boundaries right? because I am not representing the whole world, I just want my .osm that is only a small part of a small city, am I correct? What can I do in order to avoid this error? thank you so much in advace.

Hi Jorge,

those are mandatory files:
http://wiki.openstreetmap.org/wiki/Mapnik#World_boundaries

I advise you to generate a full world map before zooming to your city to ensure that your installation is working.

Thank you very much for your help, I already done so and now I can do the ./generate-xml.py comand like this:

“./generate_xml.py --host localhost --user gisuser --dbname gis --symbols ./symbols/ --world_boundaries ./world_boundaries/ --port ‘5432’ --accept-none”

and is says to me this:

Include files written successfully! Pass the osm.xml file as an argument if you want to serialize a new version or test reading the XML

So I though everything was working properly until I got this error trying to make the final .png, just doing ./generate_image.py :

jorge@jorge-VirtualBox:~/Escritorio/prueba/mapnik$ ./generate_image.py
/usr/lib/pymodules/python2.7/mapnik2/init.py:27: DeprecationWarning: mapnik2 module has been deprecated,
please use ‘import mapnik’
warnings.warn(msg, DeprecationWarning)
Traceback (most recent call last):
File “./generate_image.py”, line 42, in
mapnik.load_map(m,mapfile)
RuntimeError: XML document not well formed:
Entity ‘layer-amenity-points’ not defined at line 3927 of ‘osm.xml’

I don’t know what is telling me, the warning I can fixed it just changing mapnik2 to mapnik, but the error I don know. I have mapnik2.1, and I have tried with 2.0 also before and I have POSTGIS 9.1. Please, anybody knows what is the problem?

Thank you in advance!

Hi, I faced the same issue with layer-amenity-symbols.xml.in

The problem was that the XML is malformed as the line 328 is duplicated, just remove the extra “” tag or update.

Springmeyer just fixed it:

https://trac.openstreetmap.org/changeset/29075/subversion

Hi, thank you very much, that was the problem. I deleted that line and the error didn’t show up. Although I got now another error, this one has to take part with the world boundaries, and I think the problem has to be with something related with the name of the files, the error looks like this:

jorge@jorge-VirtualBox:~/Escritorio/prueba/mapnik$ ./generate_image.py
Traceback (most recent call last):
File “./generate_image.py”, line 42, in
mapnik.load_map(m,mapfile)
RuntimeError: Shape Plugin: shapefile ‘/home/jorge/Escritorio/prueba/mapnik/./world_boundaries//110m_admin_0_boundary_lines_land.shp’ does not exist encountered during parsing of layer ‘necountries’ in Layer at line 58 of ‘osm.xml’

I have noticed that in the webpage I am following in order to make this rendering ( http://wiki.openstreetmap.org/wiki/Mapnik ) there is an error, because when I download the external shapefiles and then I tried to unzip the last two I have to change the name in the comand of the file in order to unzip, I though maybe the error came from that:

Name of the files:

ne_10m_populated_places.zip (1.5 MB)
ne_110m_admin_0_boundary_lines_land.zip (38 KB)

Comand to unzip:

unzip 10m-populated-places.zip -d world_boundaries
unzip 110m-admin-0-boundary-lines.zip -d world_boundaries

I hope I am really close in order to make the final .png. Thank you very much guys :slight_smile:

As I though it was a problem with the names, I have changed the name of those files .dbf and .shp and know it creates a .png, now I have just to manage somehting in order to show the part that I want, because it only shows me UK, :slight_smile:

Everything works fine now, thank you so much for your help, I really appreciate it. :smiley: