Beispiel #1
0
def getKMLForAllCollarPoints(request, theCollarID):
    theCollar = get_object_or_404(Collar, collarID=theCollarID)
    dataPoints = CollarData.objects.filter(collar=theCollar)
    siteDictionary = getDictionary(request)
    siteDictionary['dataPoints'] = dataPoints
    siteDictionary['theCollar'] = theCollar
    return render_to_kml('dataPoints.kml', siteDictionary, context_instance=RequestContext(request))
Beispiel #2
0
def kml_view(request, nazev_vrstvy):
    # najdeme vrstvu podle slugu. pokud neexistuje, vyhodime 404
    v = get_object_or_404(Vrstva, slug=nazev_vrstvy, status__show=True)

    # vsechny body co jsou v teto vrstve a jsou zapnute
    points = Poi.viditelne.filter(znacka__vrstva=v).filter(mesto = request.mesto).kml()
    return render_to_kml("gis/kml/vrstva.kml", { 'places' : points})
Beispiel #3
0
def kml_view(request, nazev_vrstvy):
    # najdeme vrstvu podle slugu. pokud neexistuje, vyhodime 404
    v = get_object_or_404(Vrstva, slug=nazev_vrstvy, status__show=True)

    # vsechny body co jsou v teto vrstve a jsou zapnute
    points = Poi.viditelne.filter(znacka__vrstva=v).kml()
    return render_to_kml("gis/kml/vrstva.kml", {'places': points})
Beispiel #4
0
def kml(request, queryset=None):
    ''' carrega pontos '''

    print "has key query===== %s " % (request.GET.has_key('query'));
    if request.GET.has_key('query'):
        print request.GET['query']

    print "has key ===== %s " % (request.GET.has_key('categoria'));
    if request.GET.has_key('categoria'):
        categoria = request.GET['categoria']


        markers = Ponto.objects.filter(categoria=categoria)
        print "-------------------"
    else:
        markers = Ponto.objects.all()

    markers = [{'id':mrk.id,
                 'name': mrk.titulo, 
                 'description': mrk.logradouro  ,
                 'telefone': mrk.telefone or "",
                 'site': mrk.site or "",
                 'kml': mrk.ponto and mrk.ponto.kml or '',
                 'categoria':mrk.categoria,
                 'icon_name':mrk.categoria.icon} for mrk in markers]
    
    return render_to_kml("placemarks.kml", {'places' : markers})
Beispiel #5
0
def rack_requested_kml(request):
    try:
        page_number = int(request.REQUEST.get('page_number', '1'))
    except ValueError:
        page_number = 1
    try:
        page_size = int(request.REQUEST.get('page_size', sys.maxint))
    except ValueError:
        page_size = sys.maxint
    # Get bounds from request.
    bbox = request.REQUEST.get('bbox')
    if bbox:
        bbox = [float(n) for n in bbox.split(',')]
        assert len(bbox) == 4
        geom = Polygon.from_bbox(bbox)
        racks = Rack.objects.filter(location__contained=geom)
    else:
        racks = Rack.objects.all()
    racks = racks.order_by(*DEFAULT_RACK_ORDER)
    paginator = Paginator(racks, page_size)
    page_number = min(page_number, paginator.num_pages)
    page = paginator.page(page_number)
    return render_to_kml("placemarkers.kml", {'racks' : racks,
                                              'page': page,
                                              'page_size': page_size,
                                              }) 
Beispiel #6
0
def popup_view(request, poi_id):
    # najdeme vrstvu podle slugu. pokud neexistuje, vyhodime chybu
    poi = get_object_or_404(Poi, id=poi_id)

    return render_to_kml("gis/popup.html",
                         context_instance=RequestContext(
                             request, {'poi': poi}))
Beispiel #7
0
def kml_neighborhood_feed(request, template="geotagging/geotagging.kml",
             distance_lt_km=None ,content_type_name=None,
             object_id=None):
    """
    Return a KML feed of all the geotagging in a around the user. This view takes
    an argument called `distance_lt_km` which is the radius of the permeter your
    are searching in. This feed can be restricted based on the content type of
    the element you want to get.
    """
    from django.contrib.gis.utils import GeoIP
    gip=GeoIP()
    if request.META["REMOTE_ADDR"] != "127.0.0.1":
        user_ip = request.META["REMOTE_ADDR"]
    else:
        user_ip = "populous.com"
    user_location_pnt = gip.geos(user_ip)

    criteria_pnt = {
        "point__distance_lt" : (user_location_pnt,
                                D(km=float(distance_lt_km))
                                )
            }
    if content_type_name:
        criteria_pnt["content_type__name"]==content_type_name

    geotagging = Point.objects.filter(**criteria_pnt)

    context = RequestContext(request, {
        'places' : geotagging.kml(),

    })
    return render_to_kml(template,context_instance=context)
def kml_neighborhood_feed(request, template="geotags/geotags.kml",
             distance_lt_km=None ,content_type_name=None,
             object_id=None):
    """
    Return a KML feed of all the geotags in a around the user. This view takes
    an argument called `distance_lt_km` which is the radius of the permeter your
    are searching in. This feed can be restricted based on the content type of
    the element you want to get.
    """
    gip=GeoIP()
    if request.META["REMOTE_ADDR"] != "127.0.0.1":
        user_ip = request.META["REMOTE_ADDR"]
    else:
        user_ip = "populous.com"
    user_location_pnt = gip.geos(user_ip)

    criteria_pnt = {
        "point__distance_lt" : (user_location_pnt,
                                D(km=float(distance_lt_km))
                                )
            }
    if content_type_name:
        criteria_pnt["content_type__name"]==content_type_name

    geotags = Point.objects.filter(**criteria_pnt)

    context = RequestContext(request, {
        'places' : geotags.kml(),

    })
    return render_to_kml(template,context_instance=context)
Beispiel #9
0
def community_board_kml(request, cb_id):
    try:
        cb_id = int(cb_id)
    except ValueError:
        raise Http404
    community_board = get_object_or_404(CommunityBoard, gid=cb_id)
    return render_to_kml("community_board.kml",
                         {'communityboard': community_board})
Beispiel #10
0
def borough_kml(request, boro_id):
    try:
        boro_id = int(boro_id)
    except ValueError:
        raise Http404
    borough = get_object_or_404(Borough, gid=boro_id)
    return render_to_kml('borough.kml',
                         {'borough': borough})
Beispiel #11
0
def generate_kml(request):
    """
    Generate a Google Maps compatible KML file containing
    the nodes gelocation information.
    """
    nodes = Node.objects.filter(gis__isnull=False).exclude(gis__geolocation='')
    return render_to_kml('locations.kml', {
        'locations': nodes,
        'states': STATES_LIST
    })
Beispiel #12
0
def borough_kml(request, boro_id):
    try:
        boro_id = int(boro_id)
    except ValueError:
        raise Http404
    borough = get_object_or_404(Borough, gid=boro_id)
    return render_to_kml('borough.kml',
                         {'borough': borough, 
                          'geom': borough.the_geom.simplify(tolerance=0.0005,
                                                            preserve_topology=True)})
Beispiel #13
0
    def render_to_response(self, context, **response_kwargs):
        # Expects 'places' in context, Place models fetched with .kml()
        response = render_to_kml('gis/kml/placemarks.kml', context)

        # Add header to download as an attachment
        if context.get('download', False):
            response['Content-Disposition'] = (
                'attachment; filename="%s.kml"' % context.get('filename', 'places')
            )
        return response
Beispiel #14
0
def generate_kml(request):
    """
    Generate a Google Maps compatible KML file containing
    the nodes gelocation information.
    """
    nodes = Node.objects.filter(gis__isnull=False).exclude(gis__geolocation='')
    return render_to_kml('locations.kml', {
        'locations': nodes,
        'states': STATES_LIST
    })
Beispiel #15
0
def object_list_kml(request, format='kml', template_name="minagro/proyectos.kml"):
    viviendas= Vivienda.objects.all().exclude(geometry__exact=None).order_by('departamento', 'municipio').select_related()
    if format == 'kml':
        return render_to_kml(template_name, {'object_list':viviendas})
    if format == 'kmz':
        return render_to_kmz(template_name, {'object_list':viviendas})
    if format == 'xml':
        return render_to_response(template_name, {'object_list':viviendas}, mimetype="text/xml")
    if format == 'txt':
        return render_to_response(template_name, {'object_list':viviendas}, mimetype="text/plain")
Beispiel #16
0
def kml_view(request, nazev_vrstvy):
    # najdeme vrstvu podle slugu. pokud neexistuje, vyhodime 404
    v = get_object_or_404(Vrstva, slug=nazev_vrstvy, status__show=True)

    # vsechny body co jsou v teto vrstve a jsou zapnute
    points = Poi.viditelne.filter(znacka__vrstva=v).kml()
    if is_mobilni(request):
        kml_template = "gis/kml/vrstva_mobilni.kml"
    else:
        kml_template = "gis/kml/vrstva.kml"
    return render_to_kml(kml_template, {"places": points})
Beispiel #17
0
def community_board_kml(request, cb_id):
    try:
        cb_id = int(cb_id)
    except ValueError:
        raise Http404
    community_board = get_object_or_404(CommunityBoard, gid=cb_id)
    geom = community_board.the_geom.simplify(tolerance=0.0005)
    return render_to_kml("community_board.kml",
                         {'communityboard': community_board,
                          'geom': geom,
                          })
Beispiel #18
0
def cityracks_kml(request):
    bbox = request.REQUEST.get('bbox')
    if bbox:
        bbox = [float(n) for n in bbox.split(',')]
        assert len(bbox) == 4
        geom = Polygon.from_bbox(bbox)
        cityracks = CityRack.objects.filter(the_geom__within=geom)
    else:
        cityracks = CityRack.objects.all()
    return render_to_kml('cityracks.kml',
                         {'cityracks': cityracks})
Beispiel #19
0
def kml(request, label, field_name):
    placemarks = []
    klass = get_model(*label.split('.'))
    if not klass:
        raise KMLNotFound("You must supply a valid app.model label.  Got %s" % label)

    #FIXME: GMaps apparently has a limit on size of displayed kml files
    #  check if paginating w/ external refs (i.e. linked list) helps.
    placemarks.extend(list(klass._default_manager.kml(field_name)[:100]))

    #FIXME: other KML features?
    return render_to_kml('gis/kml/placemarks.kml', {'places' : placemarks})
Beispiel #20
0
def kml_view(request, nazev_vrstvy):
    # najdeme vrstvu podle slugu. pokud neexistuje, vyhodime 404
    v = get_object_or_404(OverlayLayer, slug=nazev_vrstvy, status__show=True)

    # vsechny body co jsou v teto vrstve a jsou zapnute
    points = Poi.visible.filter(marker__layer=v)
    return render_to_kml(
        "webmap/gis/kml/layer.kml", {
            'places': points,
            'site': get_current_site(request).domain,
        },
    )
Beispiel #21
0
def rack_search_kml(request):
    racks = Rack.objects.all()
    try:
        page_number = int(request.REQUEST.get('page_number', '1'))
    except ValueError:
        page_number = 1
    try:
        page_size = int(request.REQUEST.get('page_size', sys.maxint))
    except ValueError:
        page_size = sys.maxint

    status = request.GET.get('status')
    if status:
        racks = racks.filter(status=status)

    verified = request.GET.get('verified')
    if verified:
        racks = Rack.objects.filter_by_verified(verified, racks)

    # Get bounds from request.
    bbox = request.REQUEST.get('bbox')
    if bbox:
        bbox = [float(n) for n in bbox.split(',')]
        assert len(bbox) == 4
        geom = Polygon.from_bbox(bbox)
        racks = racks.filter(location__within=geom)
    cb = request.GET.get('cb')
    boro = request.GET.get('boro')
    board = None
    borough = None
    if cb is not None:
        try:
            board = CommunityBoard.objects.get(gid=int(cb))
            racks = racks.filter(location__within=board.the_geom)
        except (CommunityBoard.DoesNotExist, ValueError):
            board = None
    if board is None and boro is not None:
        try:
            borough = Borough.objects.get(gid=int(boro))
            racks = racks.filter(location__within=borough.the_geom)
        except (CommunityBoard.DoesNotExist, ValueError):
            pass
    racks = racks.order_by(*DEFAULT_RACK_ORDER)
    paginator = Paginator(racks, page_size)
    page_number = min(page_number, paginator.num_pages)
    page = paginator.page(page_number)
    votes = Vote.objects.get_scores_in_bulk(racks)
    return render_to_kml("placemarkers.kml", {'racks' : racks,
                                              'page': page,
                                              'page_size': page_size,
                                              'votes': votes,
                                              })
Beispiel #22
0
def kml_view(request, nazev_vrstvy):
    # najdeme vrstvu podle slugu. pokud neexistuje, vyhodime 404
    v = get_object_or_404(OverlayLayer, slug=nazev_vrstvy, status__show=True)

    # vsechny body co jsou v teto vrstve a jsou zapnute
    points = Poi.visible.filter(marker__layer=v)
    return render_to_kml(
        "webmap/gis/kml/layer.kml",
        {
            'places': points,
            'site': get_current_site(request).domain,
        },
    )
Beispiel #23
0
def kml(request, label, field_name):
    placemarks = []
    klass = get_model(*label.split('.'))
    if not klass:
        raise KMLNotFound("You must supply a valid app.model label.  Got %s" %
                          label)

    #FIXME: GMaps apparently has a limit on size of displayed kml files
    #  check if paginating w/ external refs (i.e. linked list) helps.
    placemarks.extend(list(klass._default_manager.kml(field_name)[:100]))

    #FIXME: other KML features?
    return render_to_kml('gis/kml/placemarks.kml', {'places': placemarks})
Beispiel #24
0
def kml_view(request, layer_name):
    # find layer by slug or throw 404
    v = get_object_or_404(models.Layer, slug=layer_name, status__show=True)

    # all enabled pois in this layer
    points = models.Poi.visible.filter(marker__layer=v)
    return render_to_kml(
        "webmap/gis/kml/layer.kml", {
            'places': points,
            'markers': models.Marker.objects.all(),
            'site': get_current_site(request).domain,
        },
    )
Beispiel #25
0
def kml_detail(request, object_id=None):
    ''' carrega pontos '''
    
    ponto = get_object_or_404(Ponto, pk=object_id)
    markers = ponto


    markers = [{'id':mrk.id,
                 'name': mrk.titulo, 
                 'description': "--xxxx---",
                 'categoria':mrk.categoria,
                 'icon_name':mrk.categoria.icon_name} for mrk in markers]
    
    return render_to_kml("placemarks.kml", {'places' : markers})
Beispiel #26
0
def search_view(request, query):
    if len(query) < 3:
        return http.HttpResponseBadRequest('Insufficient query lenght')
    ikona = None

    #  nejdriv podle nazvu
    nazev_qs = Poi.viditelne.filter(Q(nazev__icontains=query))
    # pak podle popisu, adresy a nazvu znacky, pokud uz nejsou vyse
    extra_qs = Poi.viditelne.filter(Q(desc__icontains=query)|Q(address__icontains=query)|Q(znacka__nazev__icontains=query)).exclude(id__in=nazev_qs)
    # union qs nezachova poradi, tak je prevedeme na listy a spojime
    points = list(nazev_qs.kml()) + list(extra_qs.kml())
    return render_to_kml("gis/kml/vrstva.kml", {
        'places' : points,
        'ikona': ikona})
Beispiel #27
0
def search_view(request, query):
    if len(query) < 3:
        return http.HttpResponseBadRequest('Insufficient query lenght')
    ikona = None

    #  nejdriv podle nazvu
    nazev_qs = Poi.viditelne.filter(Q(nazev__icontains=query))
    # pak podle popisu, adresy a nazvu znacky, pokud uz nejsou vyse
    extra_qs = Poi.viditelne.filter(Q(desc__icontains=query)|Q(address__icontains=query)|Q(znacka__nazev__icontains=query)).exclude(id__in=nazev_qs)
    # union qs nezachova poradi, tak je prevedeme na listy a spojime
    points = list(nazev_qs.kml()) + list(extra_qs.kml())
    return render_to_kml("gis/kml/vrstva.kml", {
        'places' : points,
        'ikona': ikona})
Beispiel #28
0
def map_kml(request, pk):
    """Export datas in kml  format
    """
    qsp = MapProperty.objects.filter(wmap_id=pk)
    properties = [str(prop[0]) for prop in qsp.values_list('prop')]
    sql = """WITH projets AS (
    SELECT projet_id FROM map_map_projets
    WHERE map_id = {0}
    )
    SELECT DISTINCT(parcel_id) as id FROM parc_block_projets, parc_block
    WHERE parc_block_projets.block_id= parc_block.id
    AND projet_id IN (SELECT projet_id FROM projets);
    """.format(pk)
    ids = [p.id for p in Parcel.objects.raw(sql)]
    features = Parcel.objects.filter(pk__in=ids)

    return render_to_kml("map_parcel.kml", {'places': features})
def kml_feed(request, template="geotags/geotags.kml",
             geotag_class_name=None,content_type_name=None,
             object_id=None):
    """
    Return a KML feed of a particular geotag type : point, line, polygon
    This feed can be restricted by content_type and object_id.
    """
    geotag_class = ContentType.objects.get(name=geotag_class_name).model_class()
    if content_type_name:
        geotags = geotag_class.objects.filter(content_type__name=content_type_name)
    if object_id:
        geotags = geotags.filter(object_id=object_id)
    if object_id == None and content_type_name == None :
        geotags = geotag_class.objects.all()
    context = RequestContext(request, {
        'places' : geotags.kml(),
    })
    return render_to_kml(template,context_instance=context)
Beispiel #30
0
def kml_feed(request, template="geotagging/geotagging.kml",
             geotag_field_name=None, content_type_name=None,
             object_id=None):
    """
    Return a KML feed of a particular geotag type : point, line, polygon
    This feed can be restricted by content_type and object_id.
    """
    if geotag_field_name:
        kw = str('%s__isnull' % geotag_field_name)
        geotagging = Geotag.objects.filter(**{kw:False})
    if content_type_name:
        geotagging = geotagging.objects.filter(content_type__name=content_type_name)
    if object_id:
        geotagging = geotagging.filter(object_id=object_id)
    context = RequestContext(request, {
        'places' : geotagging.kml(),
    })
    return render_to_kml(template,context_instance=context)
Beispiel #31
0
def positionsKml(request):
    """ """
    db_filter_dict = {}
    url_param_list = []
    forms.parse_filter_params(request.GET, db_filter_dict, url_param_list) 
    #
    # Only show ACTIVE rows as a part of the KML file.
    db_filter_dict[u'status__iexact'] = u'ACTIVE'
    observations  = models.SpeciesObs.objects.kml().filter(**db_filter_dict)
    #
    # Extract and aggregate data.
    taxon_pos_dict = {}
    for obs in observations:
        taxon_pos_key = (obs.scientific_name, obs.latitude_dd, obs.longitude_dd)
        if taxon_pos_key not in taxon_pos_dict:
            taxon_pos_dict[taxon_pos_key] = obs.kml # Geographic point in KML format.
    #
    # Reformat to match the template "positions_kml.kml".
    kml_name = u'SHARKdata: Marine species observations.'
    kml_description = """
        Data source: <a href="http://sharkdata.se">http://sharkdata.se</a> <br>
    """ 
    #
    kml_data = []
    for key in sorted(taxon_pos_dict.keys()):
        scientific_name, latitude, longitude = key
        #
        kml_descr = u'<p>'
        kml_descr += u'Scientific name: ' + scientific_name + u'<br>'
        kml_descr += u'Latitude: ' + latitude + u'<br>'
        kml_descr += u'Longitude: ' + longitude + u'<br>'
        kml_descr += u'</p>'
        #
        row_dict = {}
        row_dict[u'kml_name'] = scientific_name
        row_dict[u'kml_description'] = kml_descr
        row_dict[u'kml_kml'] = taxon_pos_dict[key] # Geographic point in KML format.
        kml_data.append(row_dict)
        
    return render_to_kml("positions_kml.kml", {'kml_name' : kml_name,
                                             'kml_description' : kml_description,
                                             'kml_data' : kml_data})
Beispiel #32
0
def search_view(request, query):
    if len(query) < 3:
        return http.HttpResponseBadRequest('Insufficient query lenght')

    # first by name
    name_qs = models.Poi.visible.filter(Q(name__icontains=query))
    # then by description, address and marker name if not done before
    extra_qs = models.Poi.visible.filter(
        Q(desc__icontains=query) |
        Q(address__icontains=query) |
        Q(marker__name__icontains=query),
    ).exclude(id__in=name_qs)
    # union qs doesn't hold order, so transform to lists and join
    points = list(name_qs) + list(extra_qs)
    return render_to_kml(
        "webmap/gis/kml/layer.kml",
        {
            'places': points,
            'site': get_current_site(request).domain,
        },
    )
Beispiel #33
0
def points(request):
    points = UserProfile.objects.kml()
    return render_to_kml("placemarks.kml", {'points': points})
Beispiel #34
0
def rack_all_kml(request): 
    racks = Rack.objects.all()
    return render_to_kml("placemarkers.kml", {'racks' : racks}) 
Beispiel #35
0
def rack_built_kml(request): 
    racks = Rack.objects.filter(status='a')
    return render_to_kml("placemarkers.kml", {'racks' : racks}) 
Beispiel #36
0
def kml(request):
     assets  = Asset.objects.kml()
     return render_to_kml('asset/assets.kml', 
                            {'assets' : assets},
                            context_instance=RequestContext(request)) 
Beispiel #37
0
def rack_by_id_kml(request, rack_id): 
    racks = Rack.objects.filter(id=rack_id)
    return render_to_kml("placemarkers.kml",{'racks':racks})
Beispiel #38
0
def all_kml(request):
     locations  = Stretch.objects.kml()[0:10]
     return render_to_kml("placemarks.kml", {'places' : locations}) 
Beispiel #39
0
def popup_view(request, poi_id):
    # najdeme vrstvu podle slugu. pokud neexistuje, vyhodime chybu
    poi = get_object_or_404(Poi, id=poi_id)

    return render_to_kml("gis/popup.html", context_instance=RequestContext(request, {"poi": poi}))
Beispiel #40
0
def export(request):
    trees = Tree.objects.all().values('common_name', 'binomial_name',
                                      'address', 'latitude', 'longitude')
    response = render_to_kml('trees.kml', {'trees': trees})
    response['Content-Disposition'] = 'attachment; filename="arbor.kml"'
    return response
Beispiel #41
0
        if model_name == "border":
            b = o.path.transform(
                LAT_LON, True)  #have to transform boundary kml explicitly
            p['kml'] = b.kml
            p['style'] = 'border'
        if model_name == "checkpoint":
            p['name'] = o.name
            p['description'] = "%s\n%s" % (o.get_checkpoint_type_display(),
                                           o.get_direction_display())
            b = o.coords.transform(
                LAT_LON, True)  #have to transform boundary kml explicitly
            p['kml'] = b.kml
            p['style'] = 'checkpoint'
        places.append(p)

    return render_to_kml("output.kml", {'places': places, 'name': model_name})
    #return HttpResponse("not yet implemented")


def shapefile_view(request, model_name):
    return HttpResponse("not yet implemented")


def search(request):
    '''Search for a settlement or Palestinian town by name.
    Returns a list of results for jquery autocomplete'''
    try:
        query = request.GET['q']
    except KeyError:
        return HttpResponse("No query string", mimetype='text/plain')
    settlements = Settlement.objects.filter(name__istartswith=query)
Beispiel #42
0
def all_kml(request):
    locations = Site.objects.kml()
    return render_to_kml("placemarks.kml", {'places' : locations})
Beispiel #43
0
def all_kml(request):
    locations  = InterestingLocation.objects.kml()
    return render_to_kml("gis/kml/placemarks.kml", {'places' : locations})
Beispiel #44
0
def all_kml(request):
    locations = Site.objects.kml()
    return render_to_kml("placemarks.kml", {'places': locations})
Beispiel #45
0
def generateKml(request):
    context = {'MEDIA_URL': settings.MEDIA_URL}
    relatos = Relato.objects.all()
    return render_to_kml('location.html', {'relatos': relatos})
Beispiel #46
0
def get_kml_countries(request):
    """
    View for generating kml for countries.
    """
    countries = Country.objects.kml()
    return render_to_kml("gis/kml/countries.kml", {'countries': countries})
def export_kml(modeladmin, request, queryset):
    points = queryset.kml()
    return render_to_kml("webmap/gis/kml/layer.kml", {'places': points})
Beispiel #48
0
def allkml(request):
    interes = PuntosInteres.objects.kml()
    return render_to_kml('gis/kml/placemarks.kml', {'places': interes})
Beispiel #49
0
def kml(request):
    impacts = Impact.objects.all()
    return render_to_kml('impacts.kml', {"impacts": impacts})
Beispiel #50
0
def kml(request):
    assets = Asset.objects.kml()
    return render_to_kml('asset/assets.kml', {'assets': assets},
                         context_instance=RequestContext(request))
Beispiel #51
0
def comm_area_kml(request, area_number):
    ca = models.CommunityArea.objects.get(area_number=area_number)
    return render_to_kml('core/community_area.kml', {'comm_area': ca})
Beispiel #52
0
def get_units(request):
    unit_list = Unit.objects.all()

    return render_to_kml('xml/units.kml', {'unit_list': unit_list})