[OSM-dev] osm2pgsql output possible to work with Java XAPI?
Jukka Rahkonen
jukka.rahkonen at latuviitta.fi
Wed Jun 1 05:47:21 BST 2011
Ian Dees wrote:
> If you want to do something else, you'll need some other tool. osm2pgsql's
> schema and database is a good place to start if you want to generate data
> of
> some format that expects polygons, but I don't know of any tools that will
> let you query osm2pgsql's schema using OSM tags.
Here is a live example made with MapServer WMS. Map comes from osm2pgsql
schema and query hits OSM tags which are stored in a hstore column. All
the tag/value combinations are supported and can be tested, this is live
map without any tiles or cache. Just give some other values for &tag= and
&value= My demo can only pass one tag/value pair but it would not be hard
to accept more pairs combined with ANDs and ORs.
http://188.64.1.61/cgi-bin/mapserv?map=/usr/map/osm-mapserver_i.map&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=1059&HEIGHT=687&LAYERS=sea,borders,POI_free_query&TRANSPARENT=TRUE&FORMAT=image%2Fpng&BBOX=-574187,6558020,1615375,7978444&SRS=EPSG:3067&STYLES=&tag=shop&value=convenience
If you want data instead of a map, this WFS request is returning exactly
the same data that was used for rendering the image
http://188.64.1.61/cgi-bin/mapserv?map=/usr/map/osm-mapserver_i.map&REQUEST=Getfeature&SERVICE=WfS&VERSION=1.1.0&typename=POI_free_query&tag=shop&value=convenience
Polygons are supported as well, look at the map with red lakes
http://188.64.1.61/cgi-bin/mapserv?map=/usr/map/osm-mapserver_i.map&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=1059&HEIGHT=687&LAYERS=sea,borders,polygon_free_query&TRANSPARENT=TRUE&FORMAT=image%2Fpng&BBOX=-574187,6558020,1615375,7978444&SRS=EPSG:3067&STYLES=&tag=natural&value=water
It would mean rather a lot of vector data through WFS. This WFS query with
resulttype=hits reveals that there are 53458 natural=water tags in
osm_polygon table where the data are coming.
http://188.64.1.61/cgi-bin/mapserv?map=/usr/map/osm-mapserver_i.map&REQUEST=Getfeature&SERVICE=WfS&VERSION=1.1.0&typename=polygon_free_query&tag=natural&value=water&resulttype=hits
-Jukka Rahkonen-
More information about the dev
mailing list