簡體   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