Http-POST -pyyntöjen testaamiseksi on käytettävä esimerkiksi Firefox-selaimen Poster-laajennosta tai jotain muuta vastaavaa ohjelmaa tai sovellusta.
Esimerkki WFS-palvelun vastauksesta Poster-ohjelman näyttämänä on tässä kuvassa
Lähettämällä seuraava pyyntö Posterilla osoitteeseen http://hip.latuviitta.org/cgi-bin/tinyows saa vastaukseksi tiedon siitä, minkä pääkaupunkiseudun pienalueen sisällä pyyntöön sisältyvä piste on.
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" maxFeatures="1000" outputFormat="text/xml; subtype=gml/3.1.1"><wfs:Query xmlns:lv="http://latuviitta.fi/" srsName="urn:ogc:def:crs:EPSG::3067" typeName="lv:pks_pienalue"><wfs:PropertyName>lv:nimi</wfs:PropertyName><wfs:PropertyName>lv:fid</wfs:PropertyName><wfs:PropertyName>lv:geometry</wfs:PropertyName><ogc:Filter><ogc:Contains><ogc:PropertyName>lv:geometry</ogc:PropertyName><gml:Point srsName="urn:ogc:def:crs:EPSG::3067">
<gml:pos srsDimension="2">385338.63323124044 6680121.5237366</gml:pos>
</gml:Point></ogc:Contains></ogc:Filter></wfs:Query></wfs:GetFeature>
Huom. Alla virheellinen pyyntö, joka kuitenkin toimii. Lisää tietoa tulee myöhemmin.
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2"><wfs:Query xmlns:lv="http://latuviitta.fi/" typeName="lv:pks_pienalue"><ogc:PropertyName>lv:nimi</ogc:PropertyName><ogc:Filter><ogc:Contains><ogc:PropertyName>lv:geometry</ogc:PropertyName><gml:Point srsName="EPSG:3067">
<gml:pos srsDimension="2">386777.20648464165 6679152.856655289</gml:pos>
</gml:Point></ogc:Contains></ogc:Filter></wfs:Query></wfs:GetFeature>
Vastauksen oleellisin sisältö on tässä
<lv:pks_pienalue fid="pks_pienalue.181">
<lv:name>Patola</lv:name>
</lv:pks_pienalue>
ogc:Disjoint
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" maxFeatures="1000" outputFormat="text/xml; subtype=gml/3.1.1"><wfs:Query xmlns:lv="http://latuviitta.fi/" srsName="urn:ogc:def:crs:EPSG::3067" typeName="lv:pks_pienalue"><wfs:PropertyName>lv:nimi</wfs:PropertyName><wfs:PropertyName>lv:fid</wfs:PropertyName><wfs:PropertyName>lv:geometry</wfs:PropertyName><ogc:Filter><ogc:Disjoint><ogc:PropertyName>lv:geometry</ogc:PropertyName><gml:Point srsName="urn:ogc:def:crs:EPSG::3067">
<gml:pos srsDimension="2">385338.63323124044 6680121.5237366</gml:pos>
</gml:Point></ogc:Disjoint></ogc:Filter></wfs:Query></wfs:GetFeature>
Tässä virheellinen 1.0.0-pyyntö, joka kuitenkin toimii sekin.
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2"><wfs:Query xmlns:lv="http://latuviitta.fi/" typeName="lv:pks_pienalue"><ogc:PropertyName>lv:nimi</ogc:PropertyName><ogc:PropertyName>lv:fid</ogc:PropertyName><ogc:PropertyName>lv:geometry</ogc:PropertyName><ogc:Filter><ogc:Disjoint><ogc:PropertyName>lv:geometry</ogc:PropertyName><gml:Point srsName="EPSG:3067">
<gml:pos srsDimension="2">385338.63323124044 6680121.5237366</gml:pos>
</gml:Point></ogc:Disjoint></ogc:Filter></wfs:Query></wfs:GetFeature>
ogc_Intersects
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2"><wfs:Query xmlns:lv="http://latuviitta.fi/" typeName="lv:pks_pienalue"><ogc:PropertyName>lv:nimi</ogc:PropertyName><ogc:PropertyName>lv:fid</ogc:PropertyName><ogc:PropertyName>lv:geometry</ogc:PropertyName><ogc:Filter><ogc:Intersects><ogc:PropertyName>lv:geometry</ogc:PropertyName><gml:Curve srsName="EPSG:3067">
<gml:segments>
<gml:LineStringSegment><gml:posList>382189.4969372128 6679185.294027565 384657.7388973966 6681568.424196018 390019.78177641646 6680717.306278713 393424.2534456355 6683611.107197549</gml:posList>
</gml:LineStringSegment>
</gml:segments>
</gml:Curve></ogc:Intersects></ogc:Filter></wfs:Query></wfs:GetFeature>
ogc:Within
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2"><wfs:Query xmlns:lv="http://latuviitta.fi/" typeName="lv:pks_pienalue"><ogc:PropertyName>lv:nimi</ogc:PropertyName><ogc:PropertyName>lv:fid</ogc:PropertyName><ogc:PropertyName>lv:geometry</ogc:PropertyName><ogc:Filter><ogc:Within><ogc:PropertyName>lv:geometry</ogc:PropertyName><gml:Polygon>
<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates decimal="." cs="," ts=" ">381593.7143950995,6679951.300153139 382274.6087289433,6681993.98315467 387891.9869831546,6682334.430321593 388232.43415007653,6679951.300153139 388232.43415007653,6678674.623277182 383210.8384379785,6678674.623277182 381593.7143950995,6679951.300153139</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon>
</ogc:Within></ogc:Filter></wfs:Query></wfs:GetFeature>
ogc:Within
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" maxFeatures="1000" outputFormat="text/xml; subtype=gml/3.1.1"><wfs:Query xmlns:lv="http://latuviitta.fi/" srsName="urn:ogc:def:crs:EPSG::3067" typeName="lv:pks_pienalue"><wfs:PropertyName>lv:nimi</wfs:PropertyName><wfs:PropertyName>lv:fid</wfs:PropertyName><wfs:PropertyName>lv:geometry</wfs:PropertyName><ogc:Filter><ogc:Within><ogc:PropertyName>lv:geometry</ogc:PropertyName><gml:Surface srsName='urn:ogc:def:crs:EPSG::3067'>
<gml:patches>
<gml:PolygonPatch>
<gml:exterior><gml:LinearRing><gml:posList srsDimension='2' count='7'>381593.7143950995 6679951.300153139 382274.6087289433 6681993.98315467 387891.9869831546 6682334.430321593 388232.43415007653 6679951.300153139 388232.43415007653 6678674.623277182 383210.8384379785 6678674.623277182 381593.7143950995 6679951.300153139</gml:posList></gml:LinearRing></gml:exterior></gml:PolygonPatch>
</gml:patches>
</gml:Surface></ogc:Within></ogc:Filter></wfs:Query></wfs:GetFeature>
ogc:Intersects
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" maxFeatures="1000" outputFormat="text/xml; subtype=gml/3.1.1"><wfs:Query xmlns:lv="http://latuviitta.fi/" srsName="urn:ogc:def:crs:EPSG::3067" typeName="lv:pks_pienalue"><wfs:PropertyName>lv:nimi</wfs:PropertyName><wfs:PropertyName>lv:fid</wfs:PropertyName><wfs:PropertyName>lv:geometry</wfs:PropertyName><ogc:Filter><ogc:Intersects><ogc:PropertyName>lv:geometry</ogc:PropertyName><gml:Surface srsName='urn:ogc:def:crs:EPSG::3067'>
<gml:patches>
<gml:PolygonPatch>
<gml:exterior><gml:LinearRing><gml:posList srsDimension='2' count='7'>381593.7143950995 6679951.300153139 382274.6087289433 6681993.98315467 387891.9869831546 6682334.430321593 388232.43415007653 6679951.300153139 388232.43415007653 6678674.623277182 383210.8384379785 6678674.623277182 381593.7143950995 6679951.300153139</gml:posList></gml:LinearRing></gml:exterior></gml:PolygonPatch>
</gml:patches>
</gml:Surface></ogc:Intersects></ogc:Filter></wfs:Query></wfs:GetFeature>
|