1. tcarobruce
  2. geo-django-piston
  3. Issues
Issue #1 resolved

doublequote character as escaped string

Anonymous created an issue

I'm coding a simple resource, of a model with PointFields, and the result looks like:

[ { "updated_date": "2011-01-29 14:33:28", "name": "First", "ubication": "{ \"type\": \"Point\", \"coordinates\": [ -58.385531, -34.689876 ] }" }, { "updated_date": "2011-01-30 14:33:28", "name": "Second", "ubication": "{ \"type\": \"Point\", \"coordinates\": [ -58.435335, -34.613891 ] }" } ]

This is not a valid JSON.. any idea of how to remove "\"?

Comments (1)

  1. tcarobruce repo owner

    Hi! I pushed out a quick fix for JSON encoding: 4b744328a5bf

    It's not an elegant fix -- it re-serializes the geometry's geojson into a python object so the JSON serializer can serialize it again -- but it seems to work. Probably not great for large geometries or where speed is of the essence.

    I should also note that there's a more standard format for geographic features in JSON: geojson. It might be worth writing a custom emitter for this format. (See the KML emitter in examples.)

    I have not been actively developing this project, as it never got much use.

  2. Log in to comment