【发布时间】:2018-08-03 11:06:42
【问题描述】:
所以我只用了 2 个工作日来解决这个问题。我们是地图的自动渲染过程。所有数据都在 SQL 库中给出,我的工作是编写“包装器”,以便我们可以在内部框架中实现它。除了一个需要的请求外,我管理了所有请求。 该请求是 POST 特征类型,因为这是一种创建稍后可以渲染的层的方式。
我已将所有请求保存在邮递员中,用于对 geoserver 本身提供的示例数据进行预测试。我什至无法得到状态码 201 的响应,并且总是收到 500 内部服务器错误。此状态在 sytax 中被描述为可能的语法错误。但实际上我只是复制并粘贴了示例并使用了 geoserver 提供的数据。
这是请求:http://127.0.0.1:8080/geoserver/rest/workspaces/tiger/datastores/nyc/featuretypes
及其主体:
{
"name": "poi",
"nativeName": "poi",
"namespace": {
"name": "tiger",
"href": "http://localhost:8080/geoserver/rest/namespaces/tiger.json"
},
"title": "Manhattan (NY) points of interest",
"abstract": "Points of interest in New York, New York (on Manhattan). One of the attributes contains the name of a file with a picture of the point of interest.",
"keywords": {
"string": [
"poi",
"Manhattan",
"DS_poi",
"points_of_interest",
"sampleKeyword\\@language=ab\\;",
"area of effect\\@language=bg\\;\\@vocabulary=technical\\;",
"Привет\\@language=ru\\;\\@vocabulary=friendly\\;"
]
},
"metadataLinks": {
"metadataLink": [
{
"type": "text/plain",
"metadataType": "FGDC",
"content": "www.google.com"
}
]
},
"dataLinks": {
"org.geoserver.catalog.impl.DataLinkInfoImpl": [
{
"type": "text/plain",
"content": "http://www.google.com"
}
]
},
"nativeCRS": "GEOGCS[\"WGS 84\", \n DATUM[\"World Geodetic System 1984\", \n SPHEROID[\"WGS 84\", 6378137.0, 298.257223563, AUTHORITY[\"EPSG\",\"7030\"]], \n AUTHORITY[\"EPSG\",\"6326\"]], \n PRIMEM[\"Greenwich\", 0.0, AUTHORITY[\"EPSG\",\"8901\"]], \n UNIT[\"degree\", 0.017453292519943295], \n AXIS[\"Geodetic longitude\", EAST], \n AXIS[\"Geodetic latitude\", NORTH], \n AUTHORITY[\"EPSG\",\"4326\"]]",
"srs": "EPSG:4326",
"nativeBoundingBox": {
"minx": -74.0118315772888,
"maxx": -74.00153046439813,
"miny": 40.70754683896324,
"maxy": 40.719885123828675,
"crs": "EPSG:4326"
},
"latLonBoundingBox": {
"minx": -74.0118315772888,
"maxx": -74.00857344353275,
"miny": 40.70754683896324,
"maxy": 40.711945649065406,
"crs": "EPSG:4326"
},
"projectionPolicy": "REPROJECT_TO_DECLARED",
"enabled": true,
"metadata": {
"entry": [
{
"@key": "kml.regionateStrategy",
"$": "external-sorting"
},
{
"@key": "kml.regionateFeatureLimit",
"$": "15"
},
{
"@key": "cacheAgeMax",
"$": "3000"
},
{
"@key": "cachingEnabled",
"$": "true"
},
{
"@key": "kml.regionateAttribute",
"$": "NAME"
},
{
"@key": "indexingEnabled",
"$": "false"
},
{
"@key": "dirName",
"$": "DS_poi_poi"
}
]
},
"store": {
"@class": "dataStore",
"name": "tiger:nyc",
"href": "http://localhost:8080/geoserver/rest/workspaces/tiger/datastores/nyc.json"
},
"cqlFilter": "INCLUDE",
"maxFeatures": 100,
"numDecimals": 6,
"responseSRS": {
"string": [
4326
]
},
"overridingServiceSRS": true,
"skipNumberMatched": true,
"circularArcPresent": true,
"linearizationTolerance": 10,
"attributes": {
"attribute": [
{
"name": "the_geom",
"minOccurs": 0,
"maxOccurs": 1,
"nillable": true,
"binding": "com.vividsolutions.jts.geom.Point"
},
{},
{},
{}
]
}
}
所以这是示例案例,我无法从服务器获得任何有用的响应。我得到带有正文 name 的代码 500(json 中的第一项)。同样,在尝试使用 xml 正文(第一个标签)时,我得到与正文 FeatureTypeInfo 相同的代码。
我已经在 Docker 的新地理服务器实例中尝试了请求(更改了端口),但仍然没有成功。
我检查数据存储区、工作区是否可用,并且该层“poi”尚不存在。
这里还有一些请求日志(xml body类似):
2018-08-03 07:35:02,198 错误 [geoserver.rest] - com.thoughtworks.xstream.mapper.CannotResolveClassException:名称在 com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:79) 在.....
有谁知道这个问题的解决方案并让它工作。我正在使用 GeoServer 2.13.1
【问题讨论】: