[OpenLayers-Users] How to issue custom WFS request in 2.8
Andreas Hocevar
ahocevar at opengeo.org
Sat Dec 12 13:59:33 EST 2009
Hi,
your WFS returns invalid XML:
http://att-it.homelinux.net:22080/cgi-bin/ms-5.4.2/blokknez.fcgi?service=wfs&version=1.0.0&request=getfeature&maxfeatures=1&typename=blokknezegeto:blokk2009
It returns features with a blokknezegeto namespace prefix, but no
namespace uri is assigned to this prefix
Regards,
Andreas.
Balázs Bámer wrote:
> HI All,
>
> I try to issue custom WFS 1.0.0 GetFeature request (could be also
> 1.1.0, doesn't matter). Goal is to count some attributes (or list them
> later). However, there is always some error, now
>
> "An attempt was made to create or change an object in a way which is
> incorrect with regard to namespaces" code: "14
> [Break on this error] node.setAttributeNS(uri, name, value);\n"
>
> What is the correct way to do this in OpenLayers 2.8? Something
> similar worked in 2.7 but I need 2.8.
>
> thank you in advance, best regards: Balázs Bámer
>
> I do the following:
>
>
> filter=new OpenLayers.Filter.Comparison({
> type: OpenLayers.Filter.Comparison.EQUAL_TO,
> property: "bloaz",
> value: kerespanel.findById('bloazid').value
> });
> format = new OpenLayers.Format.WFST.v1_0_0({
> featureNS: 'blokknezegeto',
> featurePrefix: 'blokknezegeto',
> namespaces: {
> "wfs": "http://www.opengis.net/wfs",
> "ogc": "http://www.opengis.net/ogc"
> }
> });
> wfs = new OpenLayers.Protocol.WFS.v1_0_0({
> url:
> "http://att-it.homelinux.net:22080/cgi-bin/ms-5.4.2/blokknez.fcgi",
> params: {
> filter: filter,
> maxFeatures: 200,
> srsName: "EPSG:23700",
> typeName: "blokk2009"
> },
> format: format,
> typename: "blokk2009",
> featureType: "blokk2009",
> featureNS: "blokknezegeto",
> feturePrefix: "blokknezegeto",
> geometryName: "bgeom"
> });
> wfs.read({
> callback: function(result) {
> var gml = result.features;
> n=0;
> for(i in gml) {
> egyik=gml[i];
>
> document.getElementById("eredmeny").innerHTML="Blokk azonosito:
> "+egyik.attributes.BLOAZ+"<br>terulet (ha):
> "+egyik.attributes.BPTERHA;
> n++;
> }
> alert("ennyit talaltam: "+n);
> }/*,
> scope: this*/
> });
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list