NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi, I am trying to get the german mapnik style to work on Ubuntu 12.04 as proposed by the SVN README:

> To deploy this style use the supplied file for
> osm2pgsql and import data using the hstore extension of
> PostgreSQL (--hstore --hstore-match-only switches of osm2pgsql).
> To keep the database compatible to the "original" Mapnik style we
> now use views instead of tables. SQL scripts to set up these views
> are supplied in the views directory.

I create my database using sachsen.osm from geofabrik and osm2pgsql from the ppa:kakrueger/openstreetmap (osm2pgsql SVN version 0.81.0 (64bit id space))

osm2pgsql -m -d osm --hstore -W -S /path/to/mapnik-german/views/  mapnik/sachsen.osm

Then I create the views that are supposed to be used by the germany mapnik style:

sudo -u postgres psql osm < mapnik-german/views/view-line.sql
sudo -u postgres psql osm < mapnik-german/views/view-point.sql
sudo -u postgres psql osm < mapnik-german/views/view-polygon.sql
sudo -u postgres psql osm < mapnik-german/views/view-roads.sql

Then I create a new directory "mapnik-de" containing the mapnik-repo. I copy mapnik-german ontop of that (is that the way to go?) and copy all the template files to inc files in mapnik-de/inc-de/. I use mapnik-de as working directory.

Now, when I try to generate my xml file

./ --dbname osm --host 'localhost' --user USERNAME --port 5432 --password 'PASSWORD' --inc inc-de  osm-de.xml > osm-local.xml

I get the following error:

/usr/lib/pymodules/python2.7/mapnik2/ DeprecationWarning:  mapnik2 module has been deprecated,
        please use 'import mapnik' 
  warnings.warn(msg, DeprecationWarning)
Traceback (most recent call last):
  File "./", line 204, in <module>
  File "./", line 80, in serialize
RuntimeError: Postgis Plugin: PSQL error:
ERROR:  column "wood" does not exist
LINE 1: ...enity,landuse,leisure,man_made,military,"natural",wood,power...
Full sql was: 'SELECT * FROM (select way,aeroway,amenity,landuse,leisure,man_made,military,"natural",wood,power,tourism,coalesce("name:de",name) as name,highway,
       case when religion in ('christian','jewish') then religion else 'INT-generic'::text end as religion
       from planet_osm_polygon
       where landuse is not null
          or leisure is not null
          or aeroway in ('apron','aerodrome')
          or amenity in ('parking','university','college','school','hospital','kindergarten','grave_yard','prison')
          or military in ('barracks','danger_area')
          or "natural" in ('field','beach','desert','heath','mud','grassland','wood','sand','scrub')
          or power in ('station','sub_station','generator')
          or tourism in ('attraction','camp_site','caravan_site','picnic_site','zoo')
          or highway in ('services','rest_area')
       order by z_order,way_area desc
      ) as leisure LIMIT 0'
  encountered during parsing of layer 'landcover' in Layer at line 381 of 'osm-de.xml'

I am using mapnik 2.1.0 from the ppa:mapnik/v2.1.0

To me it looks like the generated views are not correctly accessed. When I use a custom file with osm2pgsql that contains "wood" and a couple more, then this error does not show and I can create tiles.

I am not used to postgresql or postgis. Maybe I just understood something wrong? I took a look with pgadmin3 and there are the four views and except view_osmde_roads they all contain the column "wood".

asked 29 Dec '12, 14:24

skaiwalker's gravatar image

accept rate: 0%

edited 29 Dec '12, 14:39

Your Mapnik style is trying to access the tables directly instead of the generated views.

I would assume that your prefix entity in is wrong.

It should contain <!ENTITY prefix "view_osmde"> instead of <!ENTITY prefix "planet_osm">


permanent link

answered 29 Dec '12, 15:40

giggls's gravatar image

accept rate: 50%

Thanks Sven,
I simply forgot the "--prefix" option in

But there is another problem with the database. My command now looks like this:

./mapnik/ \
 --host 'localhost' \
 --port 5432 \
 --dbname osm \
 --prefix view_osmde \
 --user postgres \
 --password 'USERPWD' \
 --inc /home/USERNAME/osm/mapnik-german/inc-de \
 --world_boundaries /home/USERNAME/osm/mapnik/world_boundaries \
 /home/USERNAME/osm/mapnik-german/osm-de.xml > /home/USERNAME/osm/mapnik-german/osm-local.xml

And it works.

When I run, it only generates 0/0/0.png and I get errors like this:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/", line 551, in __bootstrap_inner
  File "/usr/lib/python2.7/", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File "./mapnik-german/", line 115, in loop
    self.render_tile(tile_uri, x, y, z)
  File "./mapnik-german/", line 97, in render_tile
    mapnik.render(self.m, im)
RuntimeError: PostGIS: geometry name lookup failed for table 'view_osmde_point'. Please manually provide the 'geometry_field' parameter or add an entry in the geometry_columns for 'view_osmde_point'.

What does that mean? Cheers!

(29 Dec '12, 18:57) skaiwalker

After some googling I found this function "populate_geometry_columns()" and it seemed to do the job:

sudo -u postgres psql -d osm
SELECT populate_geometry_columns();

Creating tiles with german style now works.
Can you please confirm that I did the right thing? I will write up a short Quickstart guide and upload it to the repo.

permanent link

answered 29 Dec '12, 20:10

skaiwalker's gravatar image

accept rate: 0%


I had the same problem and that solved it for me too!

(27 Apr '15, 15:49) milkbread

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 29 Dec '12, 14:24

question was seen: 8,492 times

last updated: 27 Apr '15, 15:49

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum