[TinyOWS-users] Making WFS queries against hstore attribute

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Fri May 6 09:10:53 EST 2011

Olivier Courtin wrote:

> On May 6, 2011, at 2:13 PM, Rahkonen Jukka wrote:

> Hi Jukka,

>>  TinyOWS can read attributes of datatype "hstore" from PostGIS and  
>> publish them through WFS fine.

> I did'nt knew hstore before your mail, tks :)

>> This is nice.  It would be even more cool to be able to do also  
>> queries by hstore attributes but I guess it is not possible at the  
>> moment.  What do you think, could it be possible to convert for  
>> example WFS PropertyIsEqualTo filters by TinyOWS server so that they  
>> would work against PostgreSQL hstore column?
>> What I am thinking that perhaps, if WFS GetFeature would contain  
>> this kind of filter

> What about already implemented FE PropertyIsLike operator ?
> If hstore are also considered as SQL string, it should/could works.

I am not very clever in writing filters and queries but you can try PropertyIsLike with my server. It is a fresh TinyOWS rc1, and the database behind is PostgreSQL 9.0 with PostGIS 1.5.2. If you want to have your own database with hstore some day, it can be created from OSM data with osm2pgsql by using the -k switch. Before that hstore option must be added into the database by running the "hstore.sql" script from the "contrib" directory.

Visual example about hstore in action can be seen from my Mapserver WMS. Tag and value parameters get converted into query from a hstore column and changing the values will give a different map. In this demo it is possible to use only one tag and value combination but they can be whatever, for example &tag=amenity&value=restaurant.,borders,POI_free_query&TRANSPARENT=TRUE&FORMAT=image%2Fpng&BBOX=-574187,6558020,1615375,7978444&SRS=EPSG:3067&STYLES=&tag=shop&value=supermarket

With OSM data a working hstore support could make TinyOWS a better vector dowload service than any of the existing native OSM services. Naturally not suitable for OSM editing nor routing because data comes as GML or Geojson instead of OSM-xml.

-Jukka Rahkonen-

More information about the TinyOWS-users mailing list