Beispiel #1
0
 def test_unsupported_projection(self):
     source = ogc.WFSGeometrySource(self.URI, self.typename)
     with self.assertRaisesRegexp(
             ValueError, 'Geometries are only available '
             'in projection'):
         source.fetch_geometries(ccrs.PlateCarree(), [-180, 180, -90, 90])
Beispiel #2
0
 def test_fetch_geometries(self):
     source = ogc.WFSGeometrySource(self.URI, self.typename)
     # Extent covering New Zealand.
     extent = (-99012, 1523166, -6740315, -4589165)
     geoms = source.fetch_geometries(self.native_projection, extent)
     self.assertEqual(len(geoms), 23)
Beispiel #3
0
 def test_wfs_service_instance(self):
     service = WebFeatureService(self.URI)
     source = ogc.WFSGeometrySource(service, self.typename)
     self.assertIs(source.service, service)
     self.assertEqual(source.features, [self.typename])
Beispiel #4
0
 def test_default_projection(self):
     source = ogc.WFSGeometrySource(self.URI, self.typename)
     self.assertEqual(source.default_projection(), self.native_projection)
Beispiel #5
0
 def test_string_service(self):
     service = WebFeatureService(self.URI)
     source = ogc.WFSGeometrySource(self.URI, self.typename)
     self.assertIsInstance(source.service, type(service))
     self.assertEqual(source.features, [self.typename])
Beispiel #6
0
 def test_unsupported_projection(self):
     source = ogc.WFSGeometrySource(self.URI, self.typename)
     msg = 'Geometries are only available in projection'
     with pytest.raises(ValueError, match=msg):
         source.fetch_geometries(ccrs.PlateCarree(), [-180, 180, -90, 90])
Beispiel #7
0
 def test_default_projection(self):
     source = ogc.WFSGeometrySource(self.URI, self.typename)
     assert source.default_projection() == self.native_projection
Beispiel #8
0
 def test_wfs_service_instance(self):
     service = WebFeatureService(self.URI)
     source = ogc.WFSGeometrySource(service, self.typename)
     assert source.service is service
     assert source.features == [self.typename]
Beispiel #9
0
 def test_string_service(self):
     service = WebFeatureService(self.URI)
     source = ogc.WFSGeometrySource(self.URI, self.typename)
     assert isinstance(source.service, type(service))
     assert source.features == [self.typename]