Sql server 2008 OpenLayers>;地理服务器WFS请求EPSG:3857
Geoserver2.5中的WFS实现存在严重错误 我将数据集加载到SQL Server和PostGIS中。该数据集由几个点组成,采用本机EPSG:3857 已为SQL Server连接设置Geometry_Columns表,并且在Geoserver设置中一切正常 但是,尝试通过OpenLayers访问WFS: WFS 1.0.0 |获取|修复| SQL Server>OK WFS 1.0.0 |获取|修复| PostGIS>正常 WFS 1.0.0 | POST | Fixed | SQL Server>OK WFS 1.0.0 | POST | Fixed | PostGIS>正常 WFS 1.0.0 | GET | BBOX | SQL Server>失败 WFS 1.0.0 | GET | BBOX | PostGIS>OK WFS 1.0.0 | POST | BBOX | SQL Server>失败 WFS 1.0.0 | POST | BBOX | PostGIS>失败 WFS 1.1.0 |获取|修复| SQL Server>正常(但不显示在地图上) WFS 1.1.0 |获取|修复| PostGIS>正常(但不显示在地图上) WFS 1.1.0 | POST | Fixed | SQL Server>OK WFS 1.1.0 | POST | Fixed | PostGIS>正常 WFS 1.1.0 | GET | BBOX | SQL Server>失败 WFS 1.1.0 | GET | BBOX | PostGIS>正常(但不显示在地图上) WFS 1.1.0 | POST | BBOX | SQL Server>失败 WFS 1.1.0 | POST | BBOX | PostGIS>失败 唯一成功的BBOX筛选请求是1.0.0 GET on PostGIS数据源 如果有人希望自己运行测试,那么GeoServer是可公开访问的。欢迎任何建议。我真的需要让它与SQL Server一起工作 以下是我如何从Openlayers 2.13调用WFS作为POST请求:Sql server 2008 OpenLayers>;地理服务器WFS请求EPSG:3857,sql-server-2008,openlayers,postgis,geoserver,Sql Server 2008,Openlayers,Postgis,Geoserver,Geoserver2.5中的WFS实现存在严重错误 我将数据集加载到SQL Server和PostGIS中。该数据集由几个点组成,采用本机EPSG:3857 已为SQL Server连接设置Geometry_Columns表,并且在Geoserver设置中一切正常 但是,尝试通过OpenLayers访问WFS: WFS 1.0.0 |获取|修复| SQL Server>OK WFS 1.0.0 |获取|修复| PostGIS>正常 WFS 1.0.0 | POST | Fixed | SQL S
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'
})
});
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)
});
这是SQL Server数据源。将PostGIS数据源的featureType更改为“catastro_pg3857”。我将策略从Fixed切换到BBOX,对于不同的测试,版本在“1.0.0”和“1.1.0”之间
这是我的GET请求:
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'
})
});
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)
});
干杯,
Dennis我的第一次尝试是查看sqlserver中的无效几何体。您的postgis图层显示正确 当我从geoserver为sql server生成纯KML输出时,它抛出org.geoserver.platform.ServiceException:java.lang.RuntimeException:java.io.IOException:CATASTRO\u SQL3857计算边界时出错 对于postgis,KML的生成没有错误 试试这个: 更新
我很想知道结果…我刚用MapServer运行了这个程序。WFS 1.0.0/1.1.0、GET/POST、Fixed/BBOX在MapServer上都可以使用与我的GeoServer设置中相同的SQL Server数据源。仍然想知道为什么这不适用于GeoServer。我一直认为GeoServer比MapServer更先进。另外,我喜欢网络图形用户界面。感谢您的关注。我还没有为数据设置任何界限,这可能是一个问题。我不认为几何图形是一个问题,因为数据集只包含点几何图形。另一个问题可能是几何体对象是使用SRID 0定义的。所有数据都存储在同一投影中,不需要转换。但我可以看出,这可能是插件客户端的问题,插件客户端正试图请求/使用此表中的数据。是的,它也可能缺少SRID,请更新tablename set geom.STSrid=3857;就是那个。奇怪的是,在将数据移动到我的Azure数据库后,我无法再使用MapServer筛选表。将SRID更改回0修复了此问题。MapServer似乎不喜欢在空间Azure SQL表中使用SRID。GeoServer甚至不喜欢连接到Azure。GeoServer确实连接到sql Azure。您需要手动安装扩展,如果未安装,请按照此处的说明进行安装: