Talk:Mapnik

From OpenStreetMap

Jump to: navigation, search

Contents

Ubuntu Edgy file paths

I had a little trouble getting some things to work as Ubuntu uses some slightly different paths for postgresql 8.1 than I was expecting.

The mentioned 'liblwgeom.so.1.1' file actually appeared under as /usr/lib/postgresql/8.1/lib/liblwgeom.so.1.1 once I installed the postgres8.1-postgis package.

Higgy 16:36, 24 November 2006 (UTC)

Problem with libosst on debian

In the config.log I found the following error message:

/usr/include/boost/config/requires_threads.hpp:47:5: #error "Compiler threading support is not turned on. Pleas

e set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw 32)"

I had to add:

env.Append(CXXFLAGS = '-pthread')

before the:


BOOST_LIBSHEADERS = [
   ['thread', 'boost/thread/mutex.hpp', True],
   ['filesystem', 'boost/filesystem/operations.hpp', True],
   ['regex', 'boost/regex.hpp', True],
   ['program_options', 'boost/program_options.hpp', False]
]

In the mapnik/SConstruct file to configure the project.

Afterwards I get an errormessage on: that the file boost/ptr_container/ptr_vector.hpp is not found. Sven Anders 18:31, 24 November 2006 (UTC)

A few comments, and an error message (resolved)

I managed to get through the whole process. I had to install this or that package along the way and change some paths, but they were easily found. Places where one might get easily stuck are the following:

On kubuntu edgy, I had to specify some more scons paths, especially GDAL
python scons/scons.py GDAL_LIBS=/usr/share/gdal/ BOOST_INCLUDES=/usr/include/boost/ BOOST_LIBS=/usr/lib/ install

and softlink some libraries, e.g.

libboost_thread-gcc-mt-1_33_1.so

to

libboost_thread-mt.so
The sanitizer compiles gracefully using the line
gcc UTF8sanitizer.c -o utf8sanitizer

while the makefile does not.

And finally I am stuck.

I managed to install and test the mapnik demo. I sanitized my osm file (not planet.osm, but a smaller one). I installed the postgres database, and I assumed that DBNAME remains the same during the whole site. Whether as the user with full access rights, or as user postgres, the line

psql -U USER < osm.sql > insert.log

results in the following:

DROP TABLE
CREATE TABLE
                 addgeometrycolumn
------------------------------------------------------
public.planet_osm.way SRID:4326 TYPE:GEOMETRY DIMS:2
(1 row)
BEGIN
INSERT 0 1
(repeated)
INSERT 0 1
ERROR:  parse error - invalid geometry
CONTEXT:  SQL function "geomfromtext" statement 1
ERROR:  current transaction is aborted, commands ignored until end of transaction block
(repeated)
ERROR:  current transaction is aborted, commands ignored until end of transaction block
ROLLBACK
VACUUM

Is there any way how I might easily debug the file, or find out what is wrong? I am not that proficient with the Postgresql utilities, so obvious spoilers might help. Thanks in advance, -- Relet 18:54, 18 May 2007 (BST)

Where do you get that osm.sql from? The current osm2pgsql (in svn: osm/applications/utils/export/osm2pgsql/) doesn't produce any SQL files anymore as it talks directly to the database. Maybe you could try that. BTW, your postgres setup seems to be ok, it's just complaining about the data you feed it. --GabrielEbner 19:51, 18 May 2007 (BST)
Thanks a lot, that helped. Above, I used osm2pgsql.py in utils/renderer/mapnik/ as mentioned in the section getting planet.osm in the database, creating osm.sql as its output. Now, let's see into that Mapnik tutorial. :) -- Relet 00:59, 19 May 2007 (BST)

psql problems with Gentoo

I have dev-db/postgresql-8.0.15 and dev-db/postgis-1.3.1. I think this is the same as postgresql-postgis. Now doing according the manual I get:

$ psql -d gis -f /usr/share/postgresql/contrib/lwpostgis.sql 
...
psql:/usr/share/postgresql/contrib/lwpostgis.sql:6455: ERROR:  current transaction is aborted, commands ignored until end of transaction block
psql:/usr/share/postgresql/contrib/lwpostgis.sql:6460: ERROR:  current transaction is aborted, commands ignored until end of transaction block
psql:/usr/share/postgresql/contrib/lwpostgis.sql:6465: ERROR:  current transaction is aborted, commands ignored until end of transaction block
ROLLBACK

and

$ echo "ALTER TABLE geometry_columns OWNER TO username; ALTER TABLE spatial_ref_sys OWNER TO dheath;"  | psql -d gis
ERROR:  relation "geometry_columns" does not exist
ERROR:  relation "spatial_ref_sys" does not exist
$

Running Mapnik

There should be a section on how to actually launch Mapnik and use it to generate tiles. I (Dshpak) am willing to write it, and will do so once I have everything up and running. For now, I'll keep some notes here (to be eventually merged into the article):

  • The generate_tiles.py script can be used to call Mapnik
  • Bounding boxes are defined at the bottom of this script
  • This script requires the Python Imaging Library (aka PIL) (dev-python/imaging in Gentoo)
  • This script has some hard-coded paths
    • The config file must be in ~/svn.openstreetmap.org/utils/mapnik/osm.xml - Not any more: Set by environment variables.
    • The output goes to ~/osm/tiles - Not any more: Set by environment variables.
  • There appear to be multiple sets of database connection data in the osm.xml file.

Tweaking of rendering settings

Where do I suggest tweakings for the rendering (as used in The Slippy Map)? For example, the motorway_link, trunk_link, and primary_link tagged roads ought to have a narrower rendering than the motorway, trunk, and primary tagged roads. --Seav 12:51, 7 April 2008 (BST)

Personal tools
recent changes