Ejemplo n.º 1
0
 def test_datafordeleren(self):
     user, password = os.environ["DATAFORDELEREN"].split("@")
     params = {
         "username": user,
         "password": password,
         "request": "GetMap",
         "CRS": "EPSG:3857",
         "SRS": "EPSG:3857",
         "styles": "default",
         "VERSION": "1.1.1",
         "FORMAT": "image/png",
         "LAYERS": "orto_foraar",
         "BBOX": bounding_box((55.67946496, 12.56466489), ESPG="3857"),
         "WIDTH": str(400),
         "HEIGHT": str(400),
     }
     response = requests.request(
         "GET",
         "https://services.datafordeler.dk/GeoDanmarkOrto/orto_foraar/1.0.0/WMS?",
         params=params,
     )
     message = "Datafordeleren returnede status kode " + str(
         response.status_code)
     self.assertTrue((response.status_code >= 200)
                     and (response.status_code <= 299),
                     msg=message)
Ejemplo n.º 2
0
 def test_bounding_box_espg_3857(self):
     data = address_to_house_data("Jarmers Pl. 2, 1551 København")
     box = bounding_box(data["coordinates"], boxSize=200, ESPG="3857")
     self.assertEqual(
         box,
         "1398592.0975429227,7494769.030811639,1398792.0975429227,7494969.030811639",
     )
Ejemplo n.º 3
0
 def test_bounding_box_espg_25832(self):
     data = address_to_house_data("Kjærmarken 103, 6771 Gredstedbro")
     box = bounding_box(data["coordinates"], ESPG="25832")
     self.assertEqual(
         box,
         "483622.5205332278,6139451.85576636,483736.7176466355,6139564.964581125",
     )
Ejemplo n.º 4
0
 def test_dataforsyningen(self):
     params = {
         "request": "GetMap",
         "service": "WMS",
         "token": os.environ["DATAFORSYNINGEN"],
         "TRANSPARENT": "True",
         "VERSION": "1.1.1",
         "REQUEST": "GetMap",
         "FORMAT": "image/png",
         "SRS": "EPSG:3857",
         "BBOX": bounding_box((55.67946496, 12.56466489), ESPG="3857"),
         "WIDTH": str(400),
         "HEIGHT": str(400),
         "LAYERS": "BU.Building",
         "servicename": "building_inspire",
     }
     response = requests.request("GET",
                                 "https://api.dataforsyningen.dk/service?",
                                 params=params)
     message = "Dataforsyningen returnede status kode " + str(
         response.status_code)
     self.assertTrue((response.status_code >= 200)
                     and (response.status_code <= 299),
                     msg=message)
Ejemplo n.º 5
0
 def test_bounding_box_size(self):
     box = bounding_box((0, 0), boxSize=200, ESPG="3857")
     self.assertEqual(box, "-100.0,-100.0,100.0,100.0")