[OSM-dev] Query-Formats

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Tue Mar 23 14:17:35 GMT 2010


Peter Körner <osm-lists <at> mazdermind.de> writes:

> 
> Hi
> 
> On the osm dev-server we're playing around with the postgres-hstore 
> extension which allows us to repond to xapi-like queries, but with 
> already assembled LIESTRINGs and such neat things.
> 
> I'm currently thinking about the interface on how to query this resource 
> and i'd like to be able to ask queries like "all highway=trunk and 
> highway=primary with a name" what is not possible with the current 
> XAPI-Interface.


Could it be possible to make it work as Web Feature Service (WFS)? Then the
users would have a bunch of ready made clients available and a possibility to
combine OSM vectors with data from other WFS servers. A reference service is
easy to set up: import some data with osm2pgsql, install Geoserver and publish
osm_point, osm_line and osm_polygon tables through WFS. Even if we decide
to use our own interface it is worth knowing how well some already 
existing systems work.

I have been using the Finnish OSM data as demo layers with our WFS for a couple
of years now. It suits very well for that purpose because there are points,
lines and polygons and whole lot of attributes for building queries.  However,
I have never done any performance tests with OSM data and PostGIS before now 
because our real data come from Oracle.
Here are the results from my very simple test. My WFS query was this:

wget
"http://comp2.our_domain.fi:8080/geoserver/wfs?service=wfs&version=1.0.0&
request=getfeature&typename=topp:osm_line&
cql_filter=highway='unclassified'ANDname is null"

Geoserver supports CQL Filter syntax which is not according to WFS standard but
much more comfortable to write by hand.  So, no spatial filters in this query,
only two attribute filters (unclassifield highways without names). Wget result
was:  16,799,251  2.49M/s  in 5.9s.

Query took 5.9 seconds to perform, data transform rate as loose gml2 format was
2.49 megabytes per second and the result set seem to contain 16329 lines and
288283 vertices and all the attributes which osm2pgsql has imported. It makes
roughly 2.8 million nodes per minute. Server is some 5 years old single
processor 3 GHz Xeon with old time IDE disk and running on Windows XP.


-Jukka Rahkonen-





More information about the dev mailing list