This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

mapnik error. New in OpenStreetMap

0

Hi,

I'm new using OpenStreetMap and I can't obtein a render map :(

I downloaded only my country: spain.osm I'm working on Windows System and mi configuration es:

PostgresSQL + PosGIS + osmosis

Using osmosis I have be able to import de spain.osm into the data base.

Looking in the wiki for how to configure the Mapnik for render I am using the python solution using xml file.

;** part of the xml file

<Datasource>
  <Parameter name="type">postgis</Parameter>
  <Parameter name="host">localhost</Parameter>
  <Parameter name="dbname">osm</Parameter>
  <Parameter name="user">postgres</Parameter>
  <Parameter name="password">admin</Parameter>
  <Parameter name="table">(select ST_Buffer(ST_Centroid(geometry),2) as geometry, name  from world_worldborders) as world</Parameter>
  <Parameter name="extimate_extent">false</Parameter>
  <Parameter name="extent">-180,-90,180,89.99</Parameter>
</Datasource>

;***

test python file ;*

from mapnik import *

mapfile = 'test2.xml'
map_output = 'mymap.png'
m = Map(4*1024,4*1024)
load_map(m, mapfile)

bbox=(Envelope( 36.4817,-6.245,36.4518,-6.1443 ))

m.zoom_to_box(bbox)
print "Scale = " , m.scale()
render_to_file(m, map_output)

;**

When I launch the script I have the issue that world_worldborders table are not in the data base

Searching for the wiki I found that we need to incorporated in the tables the shp files: - 10m-populated-place - 110m-admin-0-boundary-lines - processed_p - shoreline_300 - world_boundaries-spherical

After insert then using the "PostGIS shapefile and DBF loader", I launch again the python script and I have the following error on the screen:

"not relationship for world_worldborders"

What do I need to do for making work this?

Thanks in advance, Manolo

asked 23 Oct '11, 20:16

manolo%20quijano's gravatar image

manolo quijano
11112
accept rate: 0%


One Answer:

0

If you want to render with mapnik, you have to use osm2pgsql to import osm data. This program does some preprocessing on multipolygons and route relations, and it creates the database fields in the way mapnik expects then.

answered 24 Oct '11, 07:15

ajoessen's gravatar image

ajoessen
16826
accept rate: 9%

Source code available on GitHub .