예제 #1
0
    def test_to_cartopy_proj(self):
        """  Tests Cartopy projection creation from a `SpatialRef` instance. """
        sref = SpatialRef(4326)
        capy_proj = sref.to_cartopy_proj()
        assert isinstance(capy_proj, ccrs.PlateCarree)

        sref = SpatialRef(self.epsg)
        capy_proj = sref.to_cartopy_proj()
        assert isinstance(capy_proj, ccrs.Projection)
예제 #2
0
    def test_to_cartopy_proj(self):
        """  Tests Cartopy projection creation from a `SpatialRef` instance. """
        sref = SpatialRef(4326)
        capy_proj = sref.to_cartopy_proj()
        assert isinstance(capy_proj, ccrs.PlateCarree)

        sref = SpatialRef(self.epsg)
        capy_proj = sref.to_cartopy_proj()
        assert isinstance(capy_proj, ccrs.TransverseMercator)

        sref = SpatialRef(102018)
        if not GDAL_3_ENABLED:
            capy_proj = sref.to_cartopy_proj()
            assert isinstance(capy_proj, ccrs.Stereographic)
        else:
            try:
                _ = sref.to_cartopy_proj()
                assert False
            except ValueError:
                assert True