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

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%


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.

permanent link

answered 24 Oct '11, 07:15

ajoessen's gravatar image

ajoessen
16826
accept rate: 9%

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×341

question asked: 23 Oct '11, 20:16

question was seen: 3,567 times

last updated: 24 Oct '11, 07:15

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