<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19019"></HEAD>
<BODY>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011>Hi,</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011>TinyOWS can read attributes of datatype "hstore" from
PostGIS and publish them through WFS fine.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011>Here
is an example DescribeFeatureType request</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011><A
href="http://188.64.1.61/cgi-bin/tinyows?service=wfs&version=1.1.0&request=describeFeatureType&typename=osm_polygon">http://188.64.1.61/cgi-bin/tinyows?service=wfs&version=1.1.0&request=describeFeatureType&typename=osm_polygon</A></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011>The
second last attribute "tags" is a hstore columg in the database. In the
TinyOWS schema it is translated into string</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011><xs:element name="tags" type="string"
nillable="true" minOccurs="0" maxOccurs="1"/></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011>This
is an example of GetFeature</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011><A
href="http://188.64.1.61/cgi-bin/tinyows?service=wfs&version=1.1.0&request=getfeature&typename=osm_polygon&maxfeatures=1">http://188.64.1.61/cgi-bin/tinyows?service=wfs&version=1.1.0&request=getfeature&typename=osm_polygon&maxfeatures=1</A></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011>It
returns all the tags in one string like</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011><tows:tags>"z_order"=>"0",
"building"=>"yes",
"way_area"=>"4541.749900"</tows:tags></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011>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?</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011>The
SQL syntax with hstore looks odd and I do not really understand it yet, but
queries like these are working</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011>select
* FROM osm_polygon where ((tags->'building') = 'yes');<BR>select * from
osm_polygon where (tags @>'building=>yes')</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011>What I
am thinking that perhaps, if WFS GetFeature would contain this kind of
filter</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011><ogc:Filter><BR><ogc:PropertyIsEqualTo><BR><ogc:PropertyName>tags</ogc:PropertyName><BR><ogc:Literal>(tags
@>'building=>yes')</ogc:Literal><BR></ogc:PropertyIsEqualTo><BR></ogc:Filter></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011>then
if TinyOWS recognises that tags column in the database is of datatype "hstore",
it would convert the filter into </SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011>where
((tags->'building') = 'yes')</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011>Does
this sound like a useful feature and possible to implement?</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011>-Jukka
Rahkonen-</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN
class=331571811-06052011></SPAN></FONT> </DIV></BODY></HTML>