serpy icon indicating copy to clipboard operation
serpy copied to clipboard

Django GeoJSON / Geometry fields.

Open jackdh opened this issue 5 years ago • 1 comments

Is there a way to get these to work? I've had ago but it doesn't seem to like them being treated as JSON fields.

I get the following message:

"Object of type 'Point' is not JSON serializable"

jackdh avatar Aug 07 '19 13:08 jackdh

Hi @jackdh. I had the same requirement as you and have started implementing this in serpy here: https://github.com/stuart23/serpy/tree/stuart23-GeoJSON_serializer

Currently it will output a GeoJSON when using the GeoJSONserializer, but will only serialize PointFields. I will be adding more of the geometry types soon.

stuart23 avatar Aug 18 '20 19:08 stuart23