0

这是我试图用 django-leaflet 和 django-geojson 在 Django 上渲染的 geojson 对象。

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "model": "rent_app.apartment"
      },
      "id": "APT",
      "geometry": {
        "type": "Point",
        "coordinates": [
          38.771353,
          8.984487
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "model": "rent_app.apartment"
      },
      "id": "APT2",
      "geometry": {
        "type": "Point",
        "coordinates": [
          38.773155,
          8.98525
        ]
      }
    }
  ],
  "crs": {
    "type": "link",
    "properties": {
      "href": "http://spatialreference.org/ref/epsg/4326/",
      "type": "proj4"
    }
  }
}

Invalid GeoJSON object在尝试渲染geojson时得到了。有什么解决办法吗?

4

1 回答 1

0

事实证明,GeoJSON 有一个额外的大括号破坏了 geojson 格式,或者crs不再被接受。

于 2020-05-27T20:14:20.460 回答