Example #1
0
 def __init__(self, request):
     super(WMTSCapabilites, self).__init__()
     self.mapName = request.matchdict.get('map')
     self.hasMap(request.db, self.mapName)
     self.lang = request.lang
     self.models = get_wmts_models(self.lang)
     self.request = request
 def __init__(self, request):
     super(WMTSCapabilites, self).__init__()
     self.mapName = request.matchdict.get('map')
     self.hasMap(request.db, self.mapName)
     self.lang = request.lang
     self.models = get_wmts_models(self.lang)
     self.request = request
Example #3
0
 def __init__(self, request):
     super(WMTSCapabilites, self).__init__()
     self.mapName = request.matchdict.get('map')
     self.hasMap(request.db, self.mapName)
     self.lang = request.lang
     self.models = get_wmts_models(self.lang)
     self.request = request
     epsg = request.params.get('epsg', u'21781')
     available_epsg_codes = [u'21781', u'4326', u'2056', u'3857']
     if epsg not in available_epsg_codes:
         raise HTTPBadRequest('EPSG:%s not found. Must be one of %s' % (epsg, ", ".join(available_epsg_codes)))
     self.tileMatrixSet = epsg
Example #4
0
 def __init__(self, request):
     super(WMTSCapabilites, self).__init__()
     self.mapName = request.matchdict.get('map')
     self.hasMap(request.db, self.mapName)
     self.lang = request.lang
     self.models = get_wmts_models(self.lang)
     self.request = request
     epsg = request.params.get('epsg', u'21781')
     available_epsg_codes = [u'21781', u'4326', u'2056', u'3857']
     if epsg not in available_epsg_codes:
         raise HTTPBadRequest('EPSG:%s not found. Must be one of %s' %
                              (epsg, ", ".join(available_epsg_codes)))
     self.tileMatrixSet = epsg
Example #5
0
 def __init__(self, request):
     super(WMTSCapabilites, self).__init__()
     self.mapName = request.matchdict.get('map')
     self.hasMap(request.db, self.mapName)
     self.lang = request.lang
     self.models = get_wmts_models(self.lang)
     self.request = request
     epsg = request.params.get('epsg', '21781')
     available_epsg_codes = ['21781', '4326', '2056', '4258', '3857']
     if epsg in available_epsg_codes:
         if self.mapName != 'api' and epsg != '21781':
             raise HTTPNotFound("EPSG:%s only available for topic 'api'" % epsg)
         self.tileMatrixSet = epsg
     else:
         raise HTTPBadRequest('EPSG:%s not found. Must be one of %s' % (epsg, ", ".join(available_epsg_codes)))
Example #6
0
 def __init__(self, request):
     super(WMTSCapabilites, self).__init__()
     self.mapName = request.matchdict.get('map')
     self.hasMap(request.db, self.mapName)
     self.lang = request.lang
     self.models = get_wmts_models(self.lang)
     self.request = request
     epsg = request.params.get('epsg', '21781')
     available_epsg_codes = ['21781', '4326', '2056', '4258', '3857']
     if epsg in available_epsg_codes:
         if self.mapName != 'api' and epsg != '21781':
             raise HTTPNotFound("EPSG:%s only available for topic 'api'" %
                                epsg)
         self.tileMatrixSet = epsg
     else:
         raise HTTPBadRequest('EPSG:%s not found. Must be one of %s' %
                              (epsg, ", ".join(available_epsg_codes)))
Example #7
0
def getLayersConfigs():

    engine = engine_from_config(settings, 'sqlalchemy.bod.')
    DBSession = scoped_session(sessionmaker())
    DBSession.configure(bind=engine)

    models = get_wmts_models(LANG)
    layers_query = DBSession.query(models['GetCap'])
    layers_query = layers_query.filter(models['GetCap'].maps.ilike('%%%s%%' % 'api'))
    layers_query = filter_by_geodata_staging(
        layers_query,
        models['GetCap'].staging,
        STAGING
    )
    DBSession.close()

    return [q for q in layers_query.all()]
Example #8
0
def getLayersConfigs(topics=topics):
    session = getSession()
    models = get_wmts_models(LANG)
    conditions = []
    for topic in topics:
        conditions.append(models['GetCap'].maps.ilike('%{}%'.format(topic)))

    layers_query = session.query(models['GetCap'])
    layers_query = layers_query.filter(or_(*conditions))
    layers_query = filter_by_geodata_staging(
        layers_query,
        models['GetCap'].staging,
        STAGING
    )
    session.close()

    return [q for q in layers_query.all()]
Example #9
0
 def __init__(self, request):
     super(WMTSCapabilites, self).__init__()
     self.mapName = request.matchdict.get('map')
     self.lang = locale_negotiator(request)
     self.models = get_wmts_models(self.lang)
     self.request = request