Пример #1
0
 def __init__(self, *args, **kwargs):
     super(SitegeistView, self).__init__(*args, **kwargs)
     self._geocache = CoordinateCache("view-%s" % self.namespace)
Пример #2
0
from sitegeist.data.epa.models import Site
from sitegeist.data.nhgis.models import Tract as NHGISTract
from sitegeist.data import darksky, foursquare, wunderground, yelp
from sitegeist.cache import CoordinateCache
from sitegeist.formatting import dec2num, dec2pct, dec2curr
from sitegeist import utils, viz

RESPONSE_MIMETYPES = {
    'text/html': 'html',
    'application/json': 'json',
}
DEFAULT_RESPONSE_MIMETYPE = 'application/json'
DEFAULT_CLL = ("38.906956", "-77.042883")

logger = logging.getLogger(__name__)
boundary_cache = CoordinateCache("boundaries")

LLFORMAT = re.compile(r"^(?P<lat>\-?\d+(\.\d+)?),(?P<lon>\-?\d+(\.\d+)?)$")


class Geo(defaultdict):
    def __init__(self, *args, **kwargs):
        super(Geo, self).__init__(list, *args, **kwargs)
        self.lat = None
        self.lon = None


class SitegeistView(View):

    namespace = None