<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
<blockquote cite="mid:285641.74247.qm@web26502.mail.ukl.yahoo.com"
type="cite">
<div
style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div
style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><font
face="Tahoma" size="2">
<hr size="1"><b><span style="font-weight: bold;">Von:</span></b>
Bartłomiej Burkot <a class="moz-txt-link-rfc2396E" href="mailto:pomiarowiec10@poczta.onet.pl"><pomiarowiec10@poczta.onet.pl></a><br>
<b><span style="font-weight: bold;">An:</span></b>
<a class="moz-txt-link-abbreviated" href="mailto:users@openlayers.org">users@openlayers.org</a><br>
<b><span style="font-weight: bold;">Gesendet:</span></b> Freitag, den
11. Juni 2010, 11:12:53 Uhr<br>
<b><span style="font-weight: bold;">Betreff:</span></b>
[OpenLayers-Users] Problem with OpenLayers.Protocol.WFS from Geoserver<br>
</font><br>
Dear users<br>
<br>
Can somebody tell me why is the vectorlayer: "WFS stops from protocol <br>
WFS" in this examle not displaying?<br>
<a moz-do-not-send="true"
href="http://mapakrakow.pl/%7Ebbarni/mk4/index2.php" target="_blank">http://mapakrakow.pl/~bbarni/mk4/index2.php</a><br>
<br>
I defined 2 Vector layers both from geoserver:<br>
First as "OpenLayers.Layer.WFS" the sercond as
"OpenLayers.Layer.Vector" <br>
with "OpenLayers.Protocol.WFS".<br>
As I can see in firebug the respond from geoserver is the same GML-file
<br>
at both Layers but at "protocol.WFS" the stops are not displaying in
the <br>
map.<br>
I tryed change the version of protocol, strategy, stylemap, add the <br>
geoserver url to proxy.cgi and nothing helped.<br>
<br>
Under is my code.<br>
Can somebody explain me what I'm doing wrong? How to change <br>
OpenLayers.Protocol.WFS to request the goeserver with GET method
instead <br>
of POST?<br>
Thanks<br>
Bartek<br>
<br>
<br>
wfs = new OpenLayers.Layer.WFS( "WFS from Layer.WFS", <br>
"<a moz-do-not-send="true"
href="http://mapakrakow.pl:8080/geoserver/wfs" target="_blank">http://mapakrakow.pl:8080/geoserver/wfs</a>",<br>
{typename: 'komunikacja:przystanki_mk'},<br>
{<br>
typename: "komunikacja:przystanki_mk"<br>
}<br>
);<br>
var przystanki_wfs = new OpenLayers.Layer.Vector("WFS stops from <br>
protocol WFS", {<br>
strategies: [new OpenLayers.Strategy.BBOX()],<br>
//strategies: [new OpenLayers.Strategy.Fixed()],<br>
projection: new <br>
OpenLayers.Projection("EPSG:2180"),<br>
styleMap: styleMap1,<br>
protocol: new OpenLayers.Protocol.WFS({<br>
<br>
version: "1.0.0",<br>
srsName: "EPSG:2180",<br>
url: <br>
"<a moz-do-not-send="true"
href="http://mapakrakow.pl:8080/geoserver/wfs" target="_blank">http://mapakrakow.pl:8080/geoserver/wfs</a>",<br>
featureNS: "komunikacja", //featureNS: <br>
"komunikacja",<br>
//featureNS: <br>
"<a moz-do-not-send="true" href="http://localhost:8080/komunikacja"
target="_blank">http://localhost:8080/komunikacja</a>", //featureNS:
"komunikacja", <br>
"<a moz-do-not-send="true" href="http://mapakrakow.pl:8080/komunikacja"
target="_blank">http://mapakrakow.pl:8080/komunikacja</a>"<br>
featureType: "przystanki_mk",<br>
geometryName: "the_geom",<br>
featurePrefix:"komunikacja",<br>
<br>
extractAttributes: false<br>
<br>
//schema:"<a moz-do-not-send="true"
href="http://mapakrakow.pl:8080/geoserver/wfs?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName=komunikacja:przystanki_mk"
target="_blank">http://mapakrakow.pl:8080/geoserver/wfs?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName=komunikacja:przystanki_mk</a>"<br>
})<br>
});<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a moz-do-not-send="true" ymailto="mailto:Users@openlayers.org"
href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a moz-do-not-send="true"
href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
</div>
</div>
</div>
<br>
</blockquote>
<br>
<br>
<blockquote cite="mid:285641.74247.qm@web26502.mail.ukl.yahoo.com"
type="cite">
<style type="text/css"><!-- DIV {margin:0px;} --></style>
<div
style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div>Hi,<br>
<br>
AFAIK
you have to use featureNS with original namespace and not the short one
and WFS can´t do GET (but I´m not sure of this one). <br>
<br>
HTH<br>
best regards<br>
Sarah<br>
</div>
<div
style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br>
</div>
</div>
</blockquote>
<br>
When I change featureNS to<br>
featureNS: <a class="moz-txt-link-rfc2396E" href="http://mapakrakow.pl:8080/komunikacja">"http://mapakrakow.pl:8080/komunikacja"</a><br>
I get the error from firebug: <br>
<pre role="list"><code class="wrappedText focusRow" role="listitem">Could not locate {<a class="moz-txt-link-freetext" href="http://mapakrakow.pl:8080/komunikacja">http://mapakrakow.pl:8080/komunikacja</a>}przystanki_mk in catalog.</code></pre>
I cannt find the featureNS parameter in my Geoserver configuration. My
layer is defined in geoserver in workspace "komunikacja", layername is
przystanki_mk, EPSG is 2180. Geoserver has correctly <span>computed
Bounding Boxes</span> from data. Geometry columns name is the_geom,
type: Point.<br>
Geoserver has generated layer preview:<br>
<a class="moz-txt-link-freetext" href="http://mapakrakow.pl:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=komunikacja:przystanki_mk&styles=&bbox=545448.688,226900.375,586247.75,261943.359&width=512&height=439&srs=EPSG:2180&format=application/openlayers">http://mapakrakow.pl:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetMap&layers=komunikacja:przystanki_mk&styles=&bbox=545448.688,226900.375,586247.75,261943.359&width=512&height=439&srs=EPSG:2180&format=application/openlayers</a>
<br>
<br>
>From where should I read the featureNS?<br>
<br>
My GML file (respond from geoserver WFS) generated as
OpenLayers.Layer.WFS works correctly and looks like:<br>
<div selected="true" role="tabpanel"
class="netInfoResponseText
netInfoText ">
<pre role="list"><code class="wrappedText focusRow" role="listitem"><?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns=<a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/wfs">"http://www.opengis.net/wfs"</a>
xmlns</code><code class="wrappedText focusRow" role="listitem">:wfs=<a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/wfs">"http://www.opengis.net/wfs"</a>
xmlns:komunikacja=<a class="moz-txt-link-rfc2396E" href="http://localhost:8080/komunikacja">"http://localhost:8080/komunikacja"</a>
xmlns:gml="http</code><code class="wrappedText focusRow" role="listitem">://www.opengis.net/gml"
xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a>
xsi:schemaLocation="http</code><code class="wrappedText focusRow"
role="listitem">://localhost:8080/komunikacja <a class="moz-txt-link-freetext" href="http://mapakrakow.pl:8080/geoserver/wfs?service=WFS&amp;version=1.0.0&amp">http://mapakrakow.pl:8080/geoserver/wfs?service=WFS&amp;version=1.0.0&amp</a></code><code
class="wrappedText focusRow" role="listitem">;request=DescribeFeatureType&amp;typeName=komunikacja%3Aprzystanki_mk <a class="moz-txt-link-freetext" href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</a> http</code><code
class="wrappedText focusRow" role="listitem">://mapakrakow.pl:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd">
<gml:boundedBy><gml:null>unknown</gml</code><code
class="wrappedText focusRow" role="listitem">:null></gml:boundedBy>
<gml:featureMember><komunikacja:przystanki_mk fid="przystanki_mk.1195">
        <komunikacja</code><code class="wrappedText focusRow"
role="listitem">:name>N.M.P.</komunikacja:name>
        <komunikacja:idkomunika>180</komunikacja:idkomunika>
        <komunikacja:a_t>a</code><code class="wrappedText focusRow"
role="listitem"></komunikacja:a_t>
        <komunikacja:the_geom><gml:Point srsName=<a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/gml/srs/epsg.xml#2180">"http://www.opengis.net/gml/srs/epsg.xml#2180"</a></code><code
class="wrappedText focusRow" role="listitem">>
                <gml:coordinates xmlns:gml=<a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/gml">"http://www.opengis.net/gml"</a> decimal="." cs="," ts=" ">573280.14256993,244164</code><code
class="wrappedText focusRow" role="listitem">.45815782</gml:coordinates>
                </gml:Point></komunikacja:the_geom>
        <komunikacja:klucz>n.m.p.</komunikacja</code><code
class="wrappedText focusRow" role="listitem">:klucz></komunikacja:przystanki_mk>
</gml:featureMember><gml:featureMember><komunikacja:przystanki_mk</code><code
class="wrappedText focusRow" role="listitem"> fid="przystanki_mk.1257">
        <komunikacja:name>M1 Nowohucka</komunikacja:name>
        <komunikacja:idkomunika>114</code><code
class="wrappedText focusRow" role="listitem"></komunikacja:idkomunika>
        <komunikacja:a_t>a</komunikacja:a_t>
        <komunikacja:the_geom><gml:Point srsName</code><code
class="wrappedText focusRow" role="listitem">=<a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/gml/srs/epsg.xml#2180">"http://www.opengis.net/gml/srs/epsg.xml#2180"</a>>
                <gml:coordinates xmlns:gml=<a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/gml">"http://www.opengis.net/gml"</a></code><code
class="wrappedText focusRow" role="listitem"> decimal="." cs="," ts=" ">571810.60532311,244521.74814857</gml:coordinates>
                </gml:Point></komunikacja</code><code
class="wrappedText focusRow" role="listitem">:the_geom>
        <komunikacja:klucz>m1 nowohucka</komunikacja:klucz></komunikacja:przystanki_mk>
        ...
</code><code class="wrappedText focusRow" role="listitem">
</wfs:FeatureCollection</code><code class="wrappedText focusRow"
role="listitem">>
</code></pre>
</div>
<br>
Thanks for Your suggestions<br>
Bartek<br>
<br>
</body>
</html>