# Path: spillway/compat.py
# class JSONEncoder(json.JSONEncoder):
# class Mapnik(object):
#     def __getattr__(self, attr):


import collections
from django.utils import six
from greenwich.srs import SpatialReference
from spillway.compat import json, JSONEncoder

    @property
    def srs(self):
        try:
            return SpatialReference(self['crs']['properties']['name'])
        except KeyError:
            return None


class Feature(AbstractFeature):
    """GeoJSON Feature dict."""

    def __init__(self, id=None, geometry=None, properties=None,
                 crs=None, iterable=(), **kwargs):
        super(Feature, self).__init__()
        self['type'] = self.__class__.__name__
        self['geometry'] = geometry or {}
        self['properties'] = properties or kwargs or {}
        if id:
            self['id'] = id
        if crs:
            self['crs'] = NamedCRS(crs)
        self.update(iterable)

    @property
    def geojson(self):
        if not self.is_serialized('geometry'):
            return self._dumps()
        geom = self['geometry'] or '{}'
        keys = six.viewkeys(self) - {'geometry'}

# Path: spillway/compat.py
# class JSONEncoder(json.JSONEncoder):
# class Mapnik(object):
#     def __getattr__(self, attr):


# Path: spillway/collections.py
import collections
from django.utils import six
from greenwich.srs import SpatialReference
from spillway.compat import json, JSONEncoder


    @property
    def srs(self):
        try:
            return SpatialReference(self['crs']['properties']['name'])
        except KeyError:
            return None


class Feature(AbstractFeature):
    """GeoJSON Feature dict."""

    def __init__(self, id=None, geometry=None, properties=None,
                 crs=None, iterable=(), **kwargs):
        super(Feature, self).__init__()
        self['type'] = self.__class__.__name__
        self['geometry'] = geometry or {}
        self['properties'] = properties or kwargs or {}
        if id:
            self['id'] = id
        if crs:
            self['crs'] = NamedCRS(crs)
        self.update(iterable)

    @property
    def geojson(self):
        if not self.is_serialized('geometry'):
            return self._dumps()
        geom = self['geometry'] or '{}'
        keys = six.viewkeys(self) - {'geometry'}

        props = json.dumps({k: self[k] for k in keys}, cls=JSONEncoder)[1:-1]