[OpenLayers-Users] Problem with Vector_points from WFS Geoserver
Bartłomiej Burkot
pomiarowiec10 at poczta.onet.pl
Sat May 29 13:18:31 EDT 2010
Hello OLusers
I have probelm with confusing display bahavior of vectorlayer from
goeserver as WFS.
I created a rasterlayer from Mapserver and vector layer from Geoserver
as folows:
var options = {
projection: new OpenLayers.Projection("EPSG:2180"),
units: "m",
maxResolution: 10,
maxExtent: new
OpenLayers.Bounds(545440,226900,586250,261950)
};
map = new OpenLayers.Map('map',options);
var topo = new OpenLayers.Layer.WMS( "Mapa
topo","http://myserver/cgi-bin/wms?",
{layers: 'topo', format: 'image/png',projection:
"EPSG:2180" },{'buffer':0} );
map.addLayers([topo]);
wfs = new OpenLayers.Layer.WFS(
"WFS czysty",
"http://myserver:8080/geoserver/wfs",
{typename: 'komunikacja:przystanki_mk'},
{
typename: "komunikacja:przystanki_mk"
//featureNS: "http://www.openplans.org/topp",
//extractAttributes: false,
}
);
map.addLayers([wfs]);
The topo layer displays correctly in all cases. Wfs-layer don't displays
points in Mozilla 3.6.3. In IE 8 I see my vectorpoints correctly.
Please tell me wat should I add to my code to see vectorlayer in Mozilla?
In the geoserver log I see:
/geoserver/wfs?TYPENAME=komunikacja%3Aprzystanki_mk&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&SRS=EPSG%3A2180&BBOX=559123,241606,572573,247236
Also the geoserver give me the gml file and I can see this as
http://myserver:8080/geoserver/wfs?TYPENAME=komunikacja%3Aprzystanki_mk&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&SRS=EPSG%3A2180&BBOX=562938,243383.5,569768,246168.5
<wfs:FeatureCollection
xsi:schemaLocation="http://localhost:8080/komunikacja
http://myserverl:8080/geoserver/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=komunikacja%3Aprzystanki_mk
http://www.opengis.net/wfs
http://myserverl:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd">
−
<gml:boundedBy>
<gml:null>unknown</gml:null>
</gml:boundedBy>
−
<gml:featureMember>
−
<komunikacja:przystanki_mk fid="przystanki_mk.39">
<komunikacja:name>Dworzec Główny Wschód</komunikacja:name>
<komunikacja:idkomunika>461</komunikacja:idkomunika>
<komunikacja:a_t>a</komunikacja:a_t>
−
<komunikacja:the_geom>
−
<gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#2180">
<gml:coordinates decimal="." cs="," ts="
">567877.55357216,245038.45782074</gml:coordinates>
</gml:Point>
</komunikacja:the_geom>
<komunikacja:klucz>dworzec główny wschód</komunikacja:klucz>
</komunikacja:przystanki_mk>
</gml:featureMember>
−
<gml:featureMember>
−
<komunikacja:przystanki_mk fid="przystanki_mk.40">
<komunikacja:name>Dworzec Główny Wschód</komunikacja:name>
<komunikacja:idkomunika>461</komunikacja:idkomunika>
<komunikacja:a_t>a</komunikacja:a_t>
−
<komunikacja:the_geom>
−
<gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#2180">
<gml:coordinates decimal="." cs="," ts="
">567911.75531243,245032.42086227</gml:coordinates>
</gml:Point>
</komunikacja:the_geom>
...
I tried to define point layer as vectorlayer with protocol WFS (as I
found in OL discussions):
var przystanki_wfs = new OpenLayers.Layer.Vector("WFS przystanki
protocol", {
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
//protocol: new OpenLayers.Protocol.WFS.v1_1_0({
url: "http://myserver:8080/geoserver/wfs",
featureType: "komunikacja:przystanki_mk",
//featureType {String} Local (without prefix) feature typeName
(required). //TYPENAME=komunikacja:przystanki
//featureNS: "komunikacja", //featureNS
{String} Feature namespace (optional). "http://opengeo.org"
"http://postgis.org"
//featurePrefix:"komunikacja" , //Feature
namespace alias (optional - only used if featureNS is provided).
Default is ‘feature’.
//featureNS: "komunikacja",
srsName: "EPSG:2180",
version: "1.0.0" //version: "1.1.0
//schema:
"http://myserver:8080/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=komunikacja:przystanki",
})
});
map.addLayers([ przystanki_wfs]);
Now I see no one point in this layer in Mozilla and no one in IE
When I display the layer przystanki_wfs in Mozilla I see that Geoserver
logs has new lines:
91.150.223.134 - - [29/maj/2010:16:52:22 +0000] "OPTIONS
/geoserver/wfs HTTP/1.1" 200 0
91.150.223.134 - - [29/maj/2010:16:52:24 +0000] "OPTIONS
/geoserver/wfs HTTP/1.1" 200 0
When I show the new layer in IE the log looks like so:
91.150.223.134 - - [29/maj/2010:16:54:39 +0000] "POST /geoserver/wfs
HTTP/1.1" 200 23047
91.150.223.134 - - [29/maj/2010:16:54:56 +0000] "POST /geoserver/wfs
HTTP/1.1" 200 19968
I tried change the version of WFS: to version: "1.1.0",
enter a schema: as: schema:
"http://myserver:8080/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=komunikacja:przystanki",
change the: strategies: [new OpenLayers.Strategy.Fixed()],
It don't helped.
I generated the gml file from Geoserver log
/geoserver/wfs?TYPENAME=komunikacja%3Aprzystanki_mk&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&SRS=EPSG%3A2180&BBOX=559018,241636,572678,247206
and defined the layer as GML layer
var gml = new OpenLayers.Layer.GML("GML", "przystanki_gml.xml", {
format: OpenLayers.Format.GML
})
map.addLayer(gml);
Now I see the points correctly in Mozilla and in IE.
Pleace tell me what I'm doing wrong. I would like to user geoserver as
WSF-T to edit the points. What is the reason of so confusing behavior.
Thanks
Bartek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100529/655f9628/attachment.html
More information about the Users
mailing list