[OSM-dev] OSM formats optimised for client-side vector rendering?

Jukka Rahkonen jukka.rahkonen at latuviitta.fi
Thu Feb 17 20:37:42 GMT 2011

Nick Whitelegg wrote:
>>One  has to remember though that if you're using an OSM PostGIS database
>> the  raw data already is stored in a >"renderable" format, i.e. a
>> of  points and lines, so converting this to OSM format could not
>> be  done easily >because links between ways and nodes are not stored.
> Sorry , to clarify  when I say an "osm postgis database" I mean the
output of osm2pgsql - not a rails port.


I know that we do not like OGC/ISO standards but WFS might be at least
worth having a look at. It is very easy to set up WFS service on top of
osm2pgsql database with Geoserver or TinyOWS.  WFS standard output is GML
but but both those two servers can produce geojson as well if it feels

WFS gives a possibility to use many attribute and spatial filters. 
GetCapabilities shows the filters supported by my demo TinyOWS

This unfiltered request will return 100 osm_polygons in GML

and this one returns geojson

It is possible to take the geometries and all the attributes (the default)
or just a minimum amount of attributes needed for client side styling, or
plain geometries with no attributes at all, or some attributes without
geometry if there is nothing to render but you would like to build just a
list of features.

Geoserver supports at least zipped shapefiles as outputformat, and the
next Mapserver versio 6.0 will support everything supported by ogr as
outputformat (http://gdal.org/ogr/ogr_formats.html).

-Jukka Rahkonen-

More information about the dev mailing list