예제 #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])
예제 #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)
예제 #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])
예제 #4
0
 def test_default_projection(self):
     source = ogc.WFSGeometrySource(self.URI, self.typename)
     self.assertEqual(source.default_projection(), self.native_projection)
예제 #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])
예제 #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])
예제 #7
0
 def test_default_projection(self):
     source = ogc.WFSGeometrySource(self.URI, self.typename)
     assert source.default_projection() == self.native_projection
예제 #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]
예제 #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]