Invalid Geojson Object Django-leaflet [django]

104 views Asked by At

This is the geojson object I am trying to render on Django with django-leaflet and 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"
    }
  }
}

I get Invalid GeoJSON object while trying to render the geojson. Any solution?

1

There are 1 answers

0
Kaleab Woldemariam On

It turns out the GeoJSON had either an extra curly brackets which broke the geojson format or crs was not no longer accepted.