繁体   English   中英

使用Openlayers的WFS请求中出现奇怪的错误

[英]Strange error in WFS request with Openlayers

我使用OpenLayers库编写了一个脚本,以从Geoserver获取一些图层并将其显示在地图上。 我同时使用WMS和WFS层。 在Windows OS的我的本地主机(MAMP)中,一切正常。 现在,我必须在UBUNTU 12.10系统中进行迁移。 尽管我正确地获得了WMS,但是我无法使其获得WFS。

我使用了萤火虫,这是POST请求:

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <wfs:Query typeName="rural:foc_network" srsName="EPSG:4326" xmlns:rural="http://www.opengeospatial.net/rural">
 <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
 <ogc:BBOX>
 <gml:Envelope xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:4326">
 <gml:lowerCorner>21.831815896484 37.948519811767</gml:lowerCorner>
 <gml:upperCorner>22.346800027344 38.120181188719</gml:upperCorner>
 </gml:Envelope>
 </ogc:BBOX>
 </ogc:Filter>
 </wfs:Query>
</wfs:GetFeature>

这是POST响应(实际上是我的cgi文件的内容:

 #!/usr/bin/env python

"""This is a blind proxy that we use to get around browser
restrictions that prevent the Javascript from loading pages not on the
same server as the Javascript.  This has several problems: it's less
efficient, it might break some sites, and it's a security risk because
people can use this proxy to browse the web and p

在firegu的XML标记中,出现以下错误:

 XML Parsing Error: not well-formed Location: moz-nullprincipal:{79ed7c81-0daf-4525-a315-808f0894befd} Line Number 1, Column 2:

 #!/usr/bin/env python

您知道这里出了什么问题吗? 是路径:#!/ usr / bin / env python错误设置了吗? 还是其他问题?

这是我的WFS请求:

  wfs_layer_komvoi = new OpenLayers.Layer.Vector("Κόμβοι", {
        strategies: [new OpenLayers.Strategy.BBOX()],
        protocol: new OpenLayers.Protocol.WFS({
                version: "1.1.0",
                url: "http://localhost:8080/geoserver/wfs", 
                featurePrefix: "rural", //workspace from geoserver
                featureType: "komvoi_real", //layer name from geoserver
                        featureNS : "http://www.opengeospatial.net/rural", //namespace from geoserver
                        styles: "point"
                    })
                })

感谢:D。

看来问题出在网络上。 是否有来自geoserver和您的应用程序的代理? 您是否尝试过使用geoserver界面显示WFS文件而不是应用程序?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM