[mapserver-users] mapserver, ogr, osm/pbf

Lars Lingner gislars+list at googlemail.com
Sun Jul 21 03:13:59 PDT 2013


Hello,

since gdal 1.10 it is possible to access OSM files directly. Somehow I'm
struggling with the configuration.

I'm using a small extract from Berlin [1].
The ogrinfo output looks fine [2] to me.
Within in the mapfile [3] I managed to access the osm file and getting a
map back.

For the rendering I need to access the fields and their values. Thats
where I'm struggling.

This works:

...
CONNECTIONTYPE ogr
CONNECTION "/data/berlin-small.osm"
DATA "1"   ## that are the lines
...

This doesn't:

...
CONNECTIONTYPE ogr
CONNECTION "/data/berlin-small.osm"
DATA "lines"   ## DATA "SELECT * from lines"
...

I also tried using a VRT file [4] so I can access the lines directly and
applying a filter. But this didn't work either.

Probably I'm making something wrong with the DATA statement.

The second problem is with accessing a pbf file directly. Response is
"File not found or unsupported format".
I compiled MapServer with ogr/gdal 1.10 and the system is Ubuntu 12.04
and with ogrinfo I get back all infos like from the osm raw file.

My goal is to create a service which processes a small extract and
renders a overview map, without using any database.

Anybody listening here who solved something like this? Or can give other
feedback?

Thanks in advance


Lars


[1]
http://extract.bbbike.org/?sw_lng=13.425&sw_lat=52.4657&ne_lng=13.4601&ne_lat=52.4812&format=osm.bz2&city=neukoelln

[2] https://gist.github.com/gislars/6048063
[3] https://gist.github.com/gislars/6048079
[4] https://gist.github.com/gislars/6048109


More information about the mapserver-users mailing list