<!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>&nbsp;</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&amp;version=1.1.0&amp;request=describeFeatureType&amp;typename=osm_polygon">http://188.64.1.61/cgi-bin/tinyows?service=wfs&amp;version=1.1.0&amp;request=describeFeatureType&amp;typename=osm_polygon</A></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=331571811-06052011></SPAN></FONT>&nbsp;</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.&nbsp;In the 
TinyOWS schema it is translated into string</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=331571811-06052011>&lt;xs:element name="tags" type="string" 
nillable="true" minOccurs="0" maxOccurs="1"/&gt;</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=331571811-06052011></SPAN></FONT>&nbsp;</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&amp;version=1.1.0&amp;request=getfeature&amp;typename=osm_polygon&amp;maxfeatures=1">http://188.64.1.61/cgi-bin/tinyows?service=wfs&amp;version=1.1.0&amp;request=getfeature&amp;typename=osm_polygon&amp;maxfeatures=1</A></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=331571811-06052011></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011>It 
returns all the&nbsp;tags in one string like</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=331571811-06052011>&lt;tows:tags&gt;"z_order"=&gt;"0", 
"building"=&gt;"yes", 
"way_area"=&gt;"4541.749900"&lt;/tows:tags&gt;</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=331571811-06052011></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011>This 
is nice.&nbsp; It would be even more cool to be able to do also queries by 
hstore attributes but&nbsp;I guess it is not possible at the moment.&nbsp; What 
do you think, could it be possible to convert for example WFS 
PropertyIsEqualTo&nbsp;filters by TinyOWS server so that they would work 
against&nbsp;PostgreSQL hstore column?</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=331571811-06052011></SPAN></FONT>&nbsp;</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&nbsp;are working</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN class=331571811-06052011>select 
* FROM osm_polygon where ((tags-&gt;'building') = 'yes');<BR>select * from 
osm_polygon where (tags @&gt;'building=&gt;yes')</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=331571811-06052011></SPAN></FONT>&nbsp;</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>&lt;ogc:Filter&gt;<BR>&lt;ogc:PropertyIsEqualTo&gt;<BR>&lt;ogc:PropertyName&gt;tags&lt;/ogc:PropertyName&gt;<BR>&lt;ogc:Literal&gt;(tags 
@&gt;'building=&gt;yes')&lt;/ogc:Literal&gt;<BR>&lt;/ogc:PropertyIsEqualTo&gt;<BR>&lt;/ogc:Filter&gt;</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=331571811-06052011></SPAN></FONT>&nbsp;</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-&gt;'building') = 'yes')</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><SPAN 
class=331571811-06052011></SPAN></FONT>&nbsp;</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>&nbsp;</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>&nbsp;</DIV></BODY></HTML>