Beispiel #1
0
 def metadata(self):
     model = get_bod_model(self.lang)
     results = computeHeader(self.mapName)
     query = self.request.db.query(model).filter(model.maps.ilike('%%%s%%' % self.mapName))
     query = self.fullTextSearch(query, model.fullTextSearch)
     layers = [layer.layerMetadata() for layer in query]
     results['layers'].append(layers)
     return results
Beispiel #2
0
 def getLayerListFromMap(self):
     model = get_bod_model(self.lang)
     query = self.request.db.query(model).filter(
         model.maps.ilike('%%%s%%' % self.mapName))
     # only return layers which have a model
     layerList = [
         q.idBod for q in query if models_from_name(q.idBod) is not None
     ]
     return layerList
Beispiel #3
0
 def metadata(self):
     model = get_bod_model(self.lang)
     results = computeHeader(self.mapName)
     query = self.request.db.query(model).filter(
         model.maps.ilike('%%%s%%' % self.mapName))
     query = self.geodataStagingFilter(query, model.staging)
     query = self.fullTextSearch(query, [model.fullTextSearch])
     layers = [layer.layerMetadata() for layer in query]
     results['layers'].append(layers)
     return results
Beispiel #4
0
 def getLayerListFromMap(self):
     model = get_bod_model(self.lang)
     query = self.request.db.query(model).filter(
         model.maps.ilike('%%%s%%' % self.mapName)
     )
     # only return layers which have a model
     layerList = [
         q.idBod for
         q in query
         if models_from_name(q.idBod) is not None
     ]
     return layerList
Beispiel #5
0
 def getlegend(self):
     from pyramid.renderers import render_to_response
     idlayer = self.request.matchdict.get('idlayer')
     model = get_bod_model(self.lang)
     query = self.request.db.query(model).filter(model.maps.ilike('%%%s%%' % self.mapName))
     query = query.filter(model.idBod==idlayer)
     for layer in query:
         legend = {'layer': layer.layerMetadata()}
     response = render_to_response('geoadmin:templates/legend.mako', legend, request = self.request)
     if self.cbName is None:
         return response 
     else:
         return response.body
Beispiel #6
0
 def getlegend(self):
     from pyramid.renderers import render_to_response
     idlayer = self.request.matchdict.get('idlayer')
     model = get_bod_model(self.lang)
     query = self.request.db.query(model).filter(
         model.maps.ilike('%%%s%%' % self.mapName))
     query = query.filter(model.idBod == idlayer)
     for layer in query:
         legend = {'layer': layer.layerMetadata()}
     response = render_to_response('geoadmin:templates/legend.mako',
                                   legend,
                                   request=self.request)
     if self.cbName is None:
         return response
     else:
         return response.body