<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hi,<br><br><span>for example at geoserver giu you have Namespace topp then you have to declare <a target="_blank" href="http://www.openplans.org/topp">http://www.openplans.org/topp</a> as featureNS. If you have further problems I think best way is to use the geoserver mailinglist.</span><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Have you used pro4j for your epsg:2180 because OL doesn`t support this? <br><br>HTH<br>best regards<br>Sarah<br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;"></span></b><br></font><br>
<title></title>
Hi,<br>
<br>
<blockquote 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 rel="nofollow" class="moz-txt-link-rfc2396E" ymailto="mailto:pomiarowiec10@poczta.onet.pl" target="_blank" href="mailto:pomiarowiec10@poczta.onet.pl"><pomiarowiec10@poczta.onet.pl></a><br>
<b><span style="font-weight: bold;">An:</span></b>
<a rel="nofollow" class="moz-txt-link-abbreviated" ymailto="mailto:users@openlayers.org" target="_blank" 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 rel="nofollow" target="_blank" href="http://mapakrakow.pl/%7Ebbarni/mk4/index2.php">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 rel="nofollow" target="_blank" href="http://mapakrakow.pl:8080/geoserver/wfs">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 rel="nofollow" target="_blank" href="http://mapakrakow.pl:8080/geoserver/wfs">http://mapakrakow.pl:8080/geoserver/wfs</a>",<br>
featureNS: "komunikacja", //featureNS: <br>
"komunikacja",<br>
//featureNS: <br>
"<a rel="nofollow" target="_blank" href="http://localhost:8080/komunikacja">http://localhost:8080/komunikacja</a>", //featureNS:
"komunikacja", <br>
"<a rel="nofollow" target="_blank" href="http://mapakrakow.pl:8080/komunikacja">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 rel="nofollow" target="_blank" href="http://mapakrakow.pl:8080/geoserver/wfs?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName=komunikacja:przystanki_mk">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 rel="nofollow" ymailto="mailto:Users@openlayers.org" target="_blank" href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a rel="nofollow" target="_blank" href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a><br>
</div>
</div>
</div>
<br>
</blockquote>
<br>
<br>
<blockquote type="cite">
<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 rel="nofollow" class="moz-txt-link-rfc2396E" target="_blank" href="http://mapakrakow.pl:8080/komunikacja">"http://mapakrakow.pl:8080/komunikacja"</a><br>
I get the error from firebug: <br>
<pre><code class="wrappedText focusRow">Could not locate {<a rel="nofollow" class="moz-txt-link-freetext" target="_blank" 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 rel="nofollow" class="moz-txt-link-freetext" target="_blank" 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 class="netInfoResponseText
netInfoText ">
<pre><code class="wrappedText focusRow"><?xml version="1.0" encoding="UTF-8"?><br><wfs:FeatureCollection xmlns=<a rel="nofollow" class="moz-txt-link-rfc2396E" target="_blank" href="http://www.opengis.net/wfs">"http://www.opengis.net/wfs"</a> <br>xmlns</code><code class="wrappedText focusRow">:wfs=<a rel="nofollow" class="moz-txt-link-rfc2396E" target="_blank" href="http://www.opengis.net/wfs">"http://www.opengis.net/wfs"</a> <br>xmlns:komunikacja=<a rel="nofollow" class="moz-txt-link-rfc2396E" target="_blank" href="http://localhost:8080/komunikacja">"http://localhost:8080/komunikacja"</a> <br>xmlns:gml="http</code><code class="wrappedText focusRow">://www.opengis.net/gml" <br>xmlns:xsi=<a rel="nofollow" class="moz-txt-link-rfc2396E" target="_blank" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a> <br>xsi:schemaLocation="http</code><code class="wrappedText focusRow">://localhost:8080/komunikacja <a
rel="nofollow" class="moz-txt-link-freetext" target="_blank" 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">;request=DescribeFeatureType&amp;typeName=komunikacja%3Aprzystanki_mk <a rel="nofollow" class="moz-txt-link-freetext" target="_blank" href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</a> http</code><code class="wrappedText focusRow">://mapakrakow.pl:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd"><br><gml:boundedBy><gml:null>unknown</gml</code><code class="wrappedText focusRow">:null></gml:boundedBy><br><gml:featureMember><komunikacja:przystanki_mk fid="przystanki_mk.1195"><br>        <komunikacja</code><code class="wrappedText focusRow">:name>N.M.P.</komunikacja:name><br>
        <komunikacja:idkomunika>180</komunikacja:idkomunika><br>        <komunikacja:a_t>a</code><code class="wrappedText focusRow"></komunikacja:a_t><br>        <komunikacja:the_geom><gml:Point srsName=<a rel="nofollow" class="moz-txt-link-rfc2396E" target="_blank" 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">><br>                <gml:coordinates xmlns:gml=<a rel="nofollow" class="moz-txt-link-rfc2396E" target="_blank" href="http://www.opengis.net/gml">"http://www.opengis.net/gml"</a> decimal="." cs="," ts=" ">573280.14256993,244164</code><code class="wrappedText focusRow">.45815782</gml:coordinates><br>                </gml:Point></komunikacja:the_geom><br>        <komunikacja:klucz>n.m.p.</komunikacja</code><code class="wrappedText
focusRow">:klucz></komunikacja:przystanki_mk><br></gml:featureMember><gml:featureMember><komunikacja:przystanki_mk</code><code class="wrappedText focusRow"> fid="przystanki_mk.1257"><br>        <komunikacja:name>M1 Nowohucka</komunikacja:name><br>        <komunikacja:idkomunika>114</code><code class="wrappedText focusRow"></komunikacja:idkomunika><br>        <komunikacja:a_t>a</komunikacja:a_t><br>        <komunikacja:the_geom><gml:Point srsName</code><code class="wrappedText focusRow">=<a rel="nofollow" class="moz-txt-link-rfc2396E" target="_blank" href="http://www.opengis.net/gml/srs/epsg.xml#2180">"http://www.opengis.net/gml/srs/epsg.xml#2180"</a>><br>                <gml:coordinates xmlns:gml=<a rel="nofollow" class="moz-txt-link-rfc2396E" target="_blank" href="http://www.opengis.net/gml">"http://www.opengis.net/gml"</a></code><code class="wrappedText focusRow"> decimal="." cs="," ts="
">571810.60532311,244521.74814857</gml:coordinates><br>                </gml:Point></komunikacja</code><code class="wrappedText focusRow">:the_geom><br>        <komunikacja:klucz>m1 nowohucka</komunikacja:klucz></komunikacja:przystanki_mk><br>        ...<br></code><code class="wrappedText focusRow">
</wfs:FeatureCollection</code><code class="wrappedText focusRow">><br></code></pre>
</div>
<br>
Thanks for Your suggestions<br>
Bartek<br>
<br>
</div></div>
</div><br></body></html>