Geoserver 2.5中的WFS实现存在严重问题 .
我将数据集加载到SQL Server和PostGIS中 . 数据集由几个点组成,位于原生EPSG:3857 .
为SQL Server连接设置了Geometry_Columns表,Geoserver设置中的所有内容都显示正常 .
但是,尝试通过OpenLayers访问WFS:
WFS 1.0.0 | GET |固定| SQL Server> OK
WFS 1.0.0 | GET |固定| PostGIS> OK
WFS 1.0.0 | POST |固定| SQL Server> OK
WFS 1.0.0 | POST |固定| PostGIS> OK
WFS 1.0.0 | GET | BBOX | SQL Server> Fail
WFS 1.0.0 | GET | BBOX | PostGIS> OK
WFS 1.0.0 | POST | BBOX | SQL Server> Fail
WFS 1.0.0 | POST | BBOX | PostGIS> Fail
WFS 1.1.0 | GET |固定| SQL Server> OK (but not displayed on map)
WFS 1.1.0 | GET |固定| PostGIS> OK (but not displayed on map)
WFS 1.1.0 | POST |固定| SQL Server> OK
WFS 1.1.0 | POST |固定| PostGIS> OK
WFS 1.1.0 | GET | BBOX | SQL Server> Fail
WFS 1.1.0 | GET | BBOX | PostGIS> OK (but not displayed on map)
WFS 1.1.0 | POST | BBOX | SQL Server> Fail
WFS 1.1.0 | POST | BBOX | PostGIS> Fail
成功的唯一BBOX过滤请求是PostGIS数据源上的1.0.0 GET .
如果有人想为自己运行测试,则可以公开访问GeoServer . 欢迎任何建议 . 我真的需要使用SQL Server .
http://developer.system-ns.net:8080/geoserver/MobileSurvey/ows?service=WFS&request=getcapabilities
以下是我如何将Openlayers 2.13中的WFS称为POST请求:
var wfsLayer = new OpenLayers.Layer.Vector('CATASTRO', {
projection: 'EPSG:3857',
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.WFS({
version: '1.0.0',
url: 'http://developer.system-ns.net:8080/geoserver/MobileSurvey/wfs',
srsName: 'EPSG:3857',
featurePrefix: 'MobileSurvey',
featureType: 'CATASTRO_SQL3857',
geometryName: 'GEOMETRY',
featureNS: 'http://argeomatica.com/MobileSurvey'
})
});
这是SQL Server数据源 . 将featureType更改为PostGIS数据源的'catastro_pg3857' . 我将策略从Fixed切换到BBOX,并将“1.0.0”和“1.1.0”之间的版本切换为不同的测试 .
这是我的GET请求:
var wfsOptions = {
url: 'http://developer.system-ns.net:8080/geoserver/MobileSurvey/ows?',
params: {
request: 'GetFeature',
service: 'WFS',
version: '1.0.0',
typeName: 'catastro_pg3857',
srsName: 'EPSG:3857'
},
format: new OpenLayers.Format.GML({
featureNS: 'http://argeomatica.com/MobileSurvey',
geometryName: 'GEOMETRY'
})
}
wfsLayer = new OpenLayers.Layer.Vector('CATASTRO', {
projection: 'EPSG:3857',
strategies: [new OpenLayers.Strategy.BBOX()],
visibility: true,
protocol: new OpenLayers.Protocol.HTTP(wfsOptions)
});
干杯,丹尼斯
1 回答
我的第一次尝试是查看sqlserver中的无效几何 . 您的postgis图层显示正确 .
当我从你的geoserver为sql server生成普通的KML输出时,它会抛出,org.geoserver.platform.ServiceException:java.lang.RuntimeException:java.io.IOException:计算CATASTRO_SQL3857的边界时发生错误
对于postgis,生成的KML没有错误 .
试试这个:
更新<Tablename here> set geom = geom.MakeValid();
很想知道结果......