[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
series
>> of  points and lines, so converting this to OSM format could not
actually
>> be  done easily >because links between ways and nodes are not stored.
>
>>Nick
>
> Sorry , to clarify  when I say an "osm postgis database" I mean the
output of osm2pgsql - not a rails port.
>

Hi,

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
better.

WFS gives a possibility to use many attribute and spatial filters. 
GetCapabilities shows the filters supported by my demo TinyOWS
http://188.64.1.61/cgi-bin/tinyows?service=wfs&version=1.0.0&request=getcapabilities

This unfiltered request will return 100 osm_polygons in GML
http://188.64.1.61/cgi-bin/tinyows?service=wfs&version=1.0.0&request=getfeature&typename=tows:osm_polygon&maxfeatures=100&srsname=EPSG:900913

and this one returns geojson
http://188.64.1.61/cgi-bin/tinyows?service=wfs&version=1.0.0&request=getfeature&typename=tows:osm_polygon&maxfeatures=100&srsname=EPSG:900913&outputformat=application/json

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