Ejemplo n.º 1
0
 def getModelsFromLayerName(self, layers_param):
     layers = self.getLayerListFromMap(
     ) if layers_param == 'all' else layers_param.split(':')[1].split(',')
     models = [
         validateLayerId(layer) for layer in layers
         if validateLayerId(layer) is not None
     ]
     return models
Ejemplo n.º 2
0
 def getModelsFromLayerName(self, layers_param):
     layers = self.getLayerListFromMap() if layers_param == 'all' else layers_param.split(':')[1].split(',')
     models = [
         validateLayerId(layer) for
         layer in layers
         if validateLayerId(layer) is not None
     ]
     return models
Ejemplo n.º 3
0
 def getFeature(self):
     idfeature = self.request.matchdict.get('idfeature')
     idlayer = self.request.matchdict.get('idlayer') 
     model = validateLayerId(idlayer)[0]
     query = self.request.db.query(model).filter(model.id==idfeature)
     if self.returnGeometry:
         feature = [f.__geo_interface__ for f in query]
     else:
         feature = [f.interface for f in query]
     feature = {'feature': feature.pop()} if len(feature) > 0 else exc.HTTPBadRequest('No feature with id %s' % idfeature)
     template = model.__template__
     return feature, template
Ejemplo n.º 4
0
 def getFeature(self):
     idfeature = self.request.matchdict.get('idfeature')
     idlayer = self.request.matchdict.get('idlayer')
     model = validateLayerId(idlayer)[0]
     query = self.request.db.query(model).filter(model.id == idfeature)
     if self.returnGeometry:
         feature = [f.__geo_interface__ for f in query]
     else:
         feature = [f.interface for f in query]
     feature = {
         'feature': feature.pop()
     } if len(feature) > 0 else exc.HTTPBadRequest('No feature with id %s' %
                                                   idfeature)
     template = model.__template__
     return feature, template