What I Met:

我使用Google Map作为底图,GeoServer作为GIS服务器,提供WMS和WFS服务 .

通过WMS正确显示该层 . 但是,当我尝试通过GeoJSON显示它时,它没有完全显示 . “不完整”意味着:大约一半的多边形被展示,但其他的没有 .

What shoud I do?

我是GIS的新手 . 我尝试了gsojson链接,发现GeoServer确实返回了一个正确的JSON字符串,大小超过200kB ......

谁能知道我遇到的错误是什么?或者告诉我如何解决它?

提前谢谢!

Data

我的GeoJSON数据是这样的:

{
"type": "FeatureCollection", 
"totalFeatures": 9, 
"features": [
    {
        "type": "Feature", 
        "id": "the_layer.1", 
        "geometry": {
            "type": "MultiPolygon", 
            "coordinates": [
                [
                    []
                ]
            ]
        }, 
        "geometry_name": "the_geom", 
        "properties": {
            "ID": "0", 
            "SYMBOL": "", 
            "NAME": ""
        }
    }, 
    {
        "type": "Feature", 
        "id": "the_layer.2", 
        "geometry": {
            "type": "MultiPolygon", 
            "coordinates": [
                [
                    []
                ]
            ]
        }, 
        "geometry_name": "the_geom", 
        "properties": {
            "ID": "0", 
            "SYMBOL": "", 
            "NAME": ""
        }
    }, 
    {
        "type": "Feature", 
        "id": "the_layer.3", 
        "geometry": {
            "type": "MultiPolygon", 
            "coordinates": [
                [
                    []
                ]
            ]
        }, 
        "geometry_name": "the_geom", 
        "properties": {
            "ID": "0", 
            "SYMBOL": "", 
            "NAME": ""
        }
    }, 
    {
        "type": "Feature", 
        "id": "the_layer.4", 
        "geometry": {
            "type": "MultiPolygon", 
            "coordinates": [
                [
                    []
                ], 
                [
                    []
                ]
            ]
        }, 
        "geometry_name": "the_geom", 
        "properties": {
            "ID": "0", 
            "SYMBOL": "", 
            "NAME": ""
        }
    }, 
    {
        "type": "Feature", 
        "id": "the_layer.5", 
        "geometry": {
            "type": "MultiPolygon", 
            "coordinates": []
        }, 
        "geometry_name": "the_geom", 
        "properties": {
            "ID": "0", 
            "SYMBOL": "", 
            "NAME": ""
        }
    }, 
    {
        "type": "Feature", 
        "id": "the_layer.6", 
        "geometry": {
            "type": "MultiPolygon", 
            "coordinates": [
                [
                    []
                ]
            ]
        }, 
        "geometry_name": "the_geom", 
        "properties": {
            "ID": "0", 
            "SYMBOL": "", 
            "NAME": ""
        }
    }, 
    {
        "type": "Feature", 
        "id": "the_layer.7", 
        "geometry": {
            "type": "MultiPolygon", 
            "coordinates": [
                [
                    []
                ]
            ]
        }, 
        "geometry_name": "the_geom", 
        "properties": {
            "ID": "0", 
            "SYMBOL": "", 
            "NAME": ""
        }
    }, 
    {
        "type": "Feature", 
        "id": "the_layer.8", 
        "geometry": {
            "type": "MultiPolygon", 
            "coordinates": [
                [
                    []
                ]
            ]
        }, 
        "geometry_name": "the_geom", 
        "properties": {
            "ID": "0", 
            "SYMBOL": "", 
            "NAME": ""
        }
    }, 
    {
        "type": "Feature", 
        "id": "the_layer.9", 
        "geometry": {
            "type": "MultiPolygon", 
            "coordinates": [
                [
                    []
                ]
            ]
        }, 
        "geometry_name": "the_geom", 
        "properties": {
            "ID": "0", 
            "SYMBOL": "", 
            "NAME": ""
        }
    }
], 
"crs": {
    "type": "name", 
    "properties": {
        "name": "urn:ogc:def:crs:EPSG::4326"
    }
}
}}

Other informtion

GeoServer版本:2.12.1

OpenLayer3,v4.6.4

我的WMS和WFS服务是从.shp文件生成的,该文件由我们的客户提供,并且是保密的 .

这是我的openlayers代码:

var drainageJson = new ol.layer.Vector({
    visible: true,
    source: new ol.source.Vector({
      format: new ol.format.GeoJSON(),
      projection: 'EPSG:4326',
      url: 'http://127.0.0.1/geoserver/cite/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=cite:the_layer&maxFeatures=50&outputFormat=application/json',
    })
  });

根据@Ian Turton的建议,我尝试使用QGIS访问WFS源,但QGIS显示:"Layer the_layer: Download of features for layer cite:the_layer failed or partially failed: Error when parsing GetFeature response : Error: not well-formed (invalid token) on line 1, column 8522. You may attempt reloading the layer with F5" .

然后我提高了GeoServer的日志级别,我得到了the log file .