[BEGINNERS] Is there a good starting point for Spatialite + Mapnik2?

114 views
Skip to first unread message

Ludwig Meyerhoff

unread,
Mar 6, 2013, 1:46:41 PM3/6/13
to spatiali...@googlegroups.com
Hallo!

Greeting to everyone, I am new to this group and to the map frameworks I
need to get a server render maps for a few clients (~20):
- Openstreetmap as data provider
- Spatialite as data storage
- Mapnik2 as renderer
- Tilestache as WMS server
- HTML + OpenLayer for visualization

I got things to work using Postgres SQL, which is oversized for that
small number of clients. This is the reason I want to switch to
Spatialite for data storage.

Above chain seems ready (plugins installed, accesses OK) but is
currently interrupted at Mapnik2: it tries to access tables which
spatialite_osm_raw did not create.
I get the following error:

RuntimeError: Sqlite Plugin: 'no such table: osm_line'
(/media/usb/osm/openstreetmap/data/osm_hamburg.sqlite)
Full sql was: 'SELECT * FROM ((select way,waterway
from osm_line
where waterway in ('stream','drain','ditch')
and (tunnel is null or tunnel != 'yes')
) as water_lines) LIMIT 1' encountered during parsing of layer
'water-lines-casing' in Layer at line 296 of
'/mnt/shares/projects/openstreetmap/mapnik/mapnik-stylesheets-master/osm.xml'


My setup:
ludwig@notebook:/media/usb/osm/openstreetmap/data$
/usr/local/bin/spatialite_osm_raw -o hamburg.osm -d osm_hamburg.sqlite
SQLite version: 3.7.13
SpatiaLite version: 4.0.0

ludwig@notebook:/mnt/shares/projects/openstreetmap/mapnik-source$ ls
inc mapnik-v2.1.0 mapnik-v2.1.0.tar.bz2





As usual in such situations, the howtos, receipes and other
documentation is not very useful: you do not know whether what you read
is outdated or not. :-(


Is here someone who can tell me a point where to start work on what is
required to get Mapnik2 to work with Spatialite?





Saluti!

Ludwig

Ludwig Meyerhoff

unread,
Mar 14, 2013, 5:34:28 PM3/14/13
to spatiali...@googlegroups.com
Hallo!

I am sorry to disturb you with an issue which seems so boring nobody
cared to reply to. :-(

Today, I realized I must do something wrong with the import of OSM data
into Spatialite. The OSM format defines nodes which can be grouped to
lines, polylines and polygons.

In the DB I get from spatialite_osm_raw, there are only nodes and ways.
Nothing else.
Is this normal? Or did I miss some step in the setup and the build process?



Saluti!

Ludwig

a.fu...@lqt.it

unread,
Mar 14, 2013, 7:36:59 PM3/14/13
to spatiali...@googlegroups.com
Hi Ludwig,

> I am sorry to disturb you with an issue which seems so boring nobody
> cared to reply to. :-(
>

I suppose that at least two better explanations are always to be
considered,
when nobody replies to some question:

A) the question itself was too much generic / unclear.
B) nobody on the Earth knows a reasonable answer.

(obviously any possible mix of A and B could be considered as well ...)

e.g.: I've personally never used neither Mapnik nor Tilescache on my
life,
and I'll define my personal knowledge about OpenLayers "less than
elementary".
... the same is probably true for many other subscribers of this ML ...


> Today, I realized I must do something wrong with the import of OSM
> data into Spatialite. The OSM format defines nodes which can be
> grouped to lines, polylines and polygons.
>
> In the DB I get from spatialite_osm_raw, there are only nodes and
> ways. Nothing else.
>

spatialite_osm_raw (as the name itself clearly states) is just intended
to create a DB strictly corresponding to XML definitions; you are
expected
to put a lot of "added value" by yourself before hoping to get out
something you can reasonably use to render a map.
just "node tags" are directly represented as Geometries in any DB
created by spatialite_osm_raw; both "way tags" and "relation tags"
are obviously supported, but simply as relational entities.
you surely need a lot of SQL queries in order to "materialize" the
corresponding Geometries.

spatialite_osm_map apparently seems to be a better candidate for this
specific purposes (at least, I imagine this ... never tried directly).

bye Sandro

--
Il messaggio e' stato analizzato alla ricerca di virus o
contenuti pericolosi da MailScanner, ed e'
risultato non infetto.

Reply all
Reply to author
Forward
0 new messages