[OSM-dev] Mapnik doesn't find geometry columns
Hans Musil
hansm at wikivoyage.org
Tue Jul 7 15:01:44 BST 2009
I'm running mapnik version 0.5.1 as shipped with Debian Lenny. Following
http://wiki.openstreetmap.org/wiki/Mapnik/Installation#For_Debian_Lenny_or_Sid,
this should be ready to work.
Also, I have downloaded the latest SVN revision from
http://svn.openstreetmap.org/applications/rendering/mapnik and done the
steps described on
http://wiki.openstreetmap.org/wiki/Mapnik#Rendering_with_Mapnik.
I have imported the extract for the UK
(http://nick.dev.openstreetmap.org/downloads/planet/uk-090701.osm.bz2)
with osm2pgsql. No problem with the import and everything looks good in
the PostGIS db. The following tables are populated with reasonably
looking data:
Schema | Name | Type | Owner
--------------+------------------------+----------+------------
public | planet_osm_line | table | hansm
public | planet_osm_nodes | table | hansm
public | planet_osm_point | table | hansm
public | planet_osm_polygon | table | hansm
public | planet_osm_rels | table | hansm
public | planet_osm_roads | table | hansm
public | planet_osm_ways | table | hansm
osm=> SELECT * FROM geometry_columns;
f_table_catalog | f_table_schema | f_table_name |
f_geometry_column | coord_dimension | srid | type
-----------------+----------------+--------------------+-------------------+-----------------+--------+------------
| public | planet_osm_point |
way | 2 | 900913 | POINT
| public | planet_osm_line |
way | 2 | 900913 | LINESTRING
| public | planet_osm_polygon |
way | 2 | 900913 | POLYGON
| public | planet_osm_roads |
way | 2 | 900913 | LINESTRING
When trying to render tiles with generate_tiles, I only get PNG files
with waterbodies and land, but not the actual OSM features. This is
independend from the zoom level.
When checking my PostgreSQL log files, I see malformed SQL queries
issued by mapnik. Obviously, it does not know about the tables' geometry
columns:
select asbinary() as geom,"highway","railway" from
(select way,highway,railway,
case when tunnel in ('yes','true','1') then 'yes'::text
else tunnel end as tunnel
from planet_osm_roads
where highway is not null
or railway is not null
order by z_order
) as roads
where && setSRID('BOX3D(-19724422.27493316
7200979.560689881,-18472078.00350883 8453323.832114212)'::box3d,537534573)
Now my big question: How do I explain mapnik that it has to use "way" as
geometry column?
Thanks for helping
Hans
More information about the dev
mailing list