Пример #1
0
 def tile_request(self, tile, auth):
     env = make_wsgi_env('',
                         extra_environ={
                             'mapproxy.authorize': auth,
                             'PATH_INFO': '/tiles/' + tile
                         })
     req = Request(env)
     return tile_request(req)
Пример #2
0
 def test_tms_request(self):
     env = {"PATH_INFO": "/tms/1.0.0/osm/5/2/3.png", "QUERY_STRING": ""}
     req = Request(env)
     tms = tile_request(req)
     assert isinstance(tms, TMSRequest)
     assert tms.tile == (2, 3, 5)
     assert tms.format == "png"
     assert tms.layer == "osm"
     assert tms.dimensions == {}
Пример #3
0
 def test_tile_request_w_epsg(self):
     env = {"PATH_INFO": "/tiles/1.0.0/osm/EPSG4326/5/2/3.png", "QUERY_STRING": ""}
     req = Request(env)
     tile_req = tile_request(req)
     assert isinstance(tile_req, TileRequest)
     eq_(tile_req.tile, (2, 3, 5))
     eq_(tile_req.format, "png")
     eq_(tile_req.layer, "osm")
     eq_(tile_req.dimensions, {"_layer_spec": "EPSG4326"})
Пример #4
0
 def test_tms_request(self):
     env = {"PATH_INFO": "/tms/1.0.0/osm/5/2/3.png", "QUERY_STRING": ""}
     req = Request(env)
     tms = tile_request(req)
     assert isinstance(tms, TMSRequest)
     eq_(tms.tile, (2, 3, 5))
     eq_(tms.format, "png")
     eq_(tms.layer, "osm")
     eq_(tms.dimensions, {})
Пример #5
0
 def test_tile_request(self):
     env = {"PATH_INFO": "/tiles/1.0.0/osm/5/2/3.png", "QUERY_STRING": ""}
     req = Request(env)
     tile_req = tile_request(req)
     assert isinstance(tile_req, TileRequest)
     assert tile_req.tile == (2, 3, 5)
     assert tile_req.origin == None
     assert tile_req.format == "png"
     assert tile_req.layer == "osm"
     assert tile_req.dimensions == {}
Пример #6
0
 def test_tile_request_flipped_y(self):
     env = {"PATH_INFO": "/tiles/1.0.0/osm/5/2/3.png", "QUERY_STRING": "origin=nw"}
     req = Request(env)
     tile_req = tile_request(req)
     assert isinstance(tile_req, TileRequest)
     eq_(tile_req.tile, (2, 3, 5))  # not jet flipped
     eq_(tile_req.origin, "nw")
     eq_(tile_req.format, "png")
     eq_(tile_req.layer, "osm")
     eq_(tile_req.dimensions, {})
Пример #7
0
 def test_tile_request_w_epsg(self):
     env = {
         'PATH_INFO': '/tiles/1.0.0/osm/EPSG4326/5/2/3.png',
         'QUERY_STRING': '',
     }
     req = Request(env)
     tile_req = tile_request(req)
     assert isinstance(tile_req, TileRequest)
     eq_(tile_req.tile, (2, 3, 5))
     eq_(tile_req.format, 'png')
     eq_(tile_req.layer, 'osm')
     eq_(tile_req.dimensions, {'_layer_spec': 'EPSG4326'})
Пример #8
0
 def test_tms_request(self):
     env = {
         'PATH_INFO': '/tms/1.0.0/osm/5/2/3.png',
         'QUERY_STRING': '',
     }
     req = Request(env)
     tms = tile_request(req)
     assert isinstance(tms, TMSRequest)
     eq_(tms.tile, (2, 3, 5))
     eq_(tms.format, 'png')
     eq_(tms.layer, 'osm')
     eq_(tms.dimensions, {})
Пример #9
0
 def test_tile_request_w_epsg(self):
     env = {
         'PATH_INFO': '/tiles/1.0.0/osm/EPSG4326/5/2/3.png',
         'QUERY_STRING': '',
     }
     req = Request(env)
     tile_req = tile_request(req)
     assert isinstance(tile_req, TileRequest)
     eq_(tile_req.tile, (2, 3, 5))
     eq_(tile_req.format, 'png')
     eq_(tile_req.layer, 'osm')
     eq_(tile_req.dimensions, {'_layer_spec': 'EPSG4326'})
Пример #10
0
 def test_tms_request(self):
     env = {
         'PATH_INFO': '/tms/1.0.0/osm/5/2/3.png',
         'QUERY_STRING': '',
     }
     req = Request(env)
     tms = tile_request(req)
     assert isinstance(tms, TMSRequest)
     eq_(tms.tile, (2, 3, 5))
     eq_(tms.format, 'png')
     eq_(tms.layer, 'osm')
     eq_(tms.dimensions, {})
Пример #11
0
 def test_tile_request_w_epsg(self):
     env = {
         "PATH_INFO": "/tiles/1.0.0/osm/EPSG4326/5/2/3.png",
         "QUERY_STRING": ""
     }
     req = Request(env)
     tile_req = tile_request(req)
     assert isinstance(tile_req, TileRequest)
     assert tile_req.tile == (2, 3, 5)
     assert tile_req.format == "png"
     assert tile_req.layer == "osm"
     assert tile_req.dimensions == {"_layer_spec": "EPSG4326"}
Пример #12
0
 def test_tile_request_flipped_y(self):
     env = {
         'PATH_INFO': '/tiles/1.0.0/osm/5/2/3.png',
         'QUERY_STRING': 'origin=nw',
     }
     req = Request(env)
     tile_req = tile_request(req)
     assert isinstance(tile_req, TileRequest)
     eq_(tile_req.tile, (2, 3, 5))  # not jet flipped
     eq_(tile_req.origin, 'nw')
     eq_(tile_req.format, 'png')
     eq_(tile_req.layer, 'osm')
     eq_(tile_req.dimensions, {})
Пример #13
0
 def test_tile_request_flipped_y(self):
     env = {
         'PATH_INFO': '/tiles/1.0.0/osm/5/2/3.png',
         'QUERY_STRING': 'origin=nw',
     }
     req = Request(env)
     tile_req = tile_request(req)
     assert isinstance(tile_req, TileRequest)
     eq_(tile_req.tile, (2, 3, 5)) # not jet flipped
     eq_(tile_req.origin, 'nw')
     eq_(tile_req.format, 'png')
     eq_(tile_req.layer, 'osm')
     eq_(tile_req.dimensions, {})
Пример #14
0
 def test_tile_request(self):
     env = {
         'PATH_INFO': '/tiles/1.0.0/osm/5/2/3.png',
         'QUERY_STRING': '',
     }
     req = Request(env)
     tile_req = tile_request(req)
     assert isinstance(tile_req, TileRequest)
     eq_(tile_req.tile, (2, 3, 5))
     eq_(tile_req.origin, None)
     eq_(tile_req.format, 'png')
     eq_(tile_req.layer, 'osm')
     eq_(tile_req.dimensions, tuple())
Пример #15
0
 def test_tile_request(self):
     env = {
         'PATH_INFO': '/tiles/1.0.0/osm/5/2/3.png',
         'QUERY_STRING': '',
     }
     req = Request(env)
     tile_req = tile_request(req)
     assert isinstance(tile_req, TileRequest)
     eq_(tile_req.tile, (2, 3, 5))
     eq_(tile_req.origin, None)
     eq_(tile_req.format, 'png')
     eq_(tile_req.layer, 'osm')
     eq_(tile_req.dimensions, tuple())
Пример #16
0
 def tile_request(self, tile, auth):
     env = make_wsgi_env('', extra_environ={'mapproxy.authorize': auth,
                                            'PATH_INFO': '/tiles/'+tile})
     req = Request(env)
     return tile_request(req)