def to_representation(self, value):
        # Create a dict from the GEOSGeometry when the value is not previously
        # serialized from the spatial db.
        try:
            return {'type': value.geom_type, 'coordinates': value.coords}
        # Value is already serialized as geojson, kml, etc.
        except __HOLE__:
            return value
dataset/ETHPy150Open bkg/django-spillway/spillway/fields.py/GeometryField.to_representation