[TinyOWS-users] Making WFS queries against hstore attribute

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Fri May 6 07:13:48 EST 2011

TinyOWS can read attributes of datatype "hstore" from PostGIS and
publish them through WFS fine.
Here is an example DescribeFeatureType request
The second last attribute "tags" is a hstore columg in the database. In
the TinyOWS schema it is translated into string
<xs:element name="tags" type="string" nillable="true" minOccurs="0"
This is an example of GetFeature
It returns all the tags in one string like
<tows:tags>"z_order"=>"0", "building"=>"yes",
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?
The SQL syntax with hstore looks odd and I do not really understand it
yet, but queries like these are working
select * FROM osm_polygon where ((tags->'building') = 'yes');
select * from osm_polygon where (tags @>'building=>yes')
What I am thinking that perhaps, if WFS GetFeature would contain this
kind of filter
<ogc:Literal>(tags @>'building=>yes')</ogc:Literal>
then if TinyOWS recognises that tags column in the database is of
datatype "hstore", it would convert the filter into 
where ((tags->'building') = 'yes')
Does this sound like a useful feature and possible to implement?
-Jukka Rahkonen-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/tinyows-users/attachments/20110506/695e4a39/attachment.htm 

More information about the TinyOWS-users mailing list