Exemplo n.º 1
0
    def __init__(self, core, continent):
        """
        Initialises an Equi7Subgrid class for a specified continent.

        Parameters
        ----------
        core : TPSCoreProperty
            defines core parameters of the (sub-) grid
        continent : str
            acronym of the continent, e.g. 'EU' or 'SA'.
        """

        # load WKT string and extent shape
        data = Equi7Grid._static_data[continent]

        _core = copy.copy(core)
        _core.tag = continent
        _core.projection = TPSProjection(wkt=data['wkt'])

        # holds core parameters of the (sub-) grid
        self.core = _core

        # holds name of the subgrid
        self.name = ''.join(('EQUI7_', continent,
                             Equi7Grid.encode_sampling(core.sampling), 'M'))

        # holds the extent of the subgrid in the lonlat-space
        self.polygon_geog = create_geometry_from_wkt(data['zone_extent'],
                                                     epsg=4326)

        # defines the tilingsystem of the subgrid
        self.tilesys = Equi7TilingSystem(self.core, self.polygon_geog)

        super(Equi7Subgrid, self).__init__(self.core, self.polygon_geog,
                                           self.tilesys)
Exemplo n.º 2
0
    def __init__(self, core, continent):
        """
        Initialises an Equi7Subgrid class for a specified continent.

        Parameters
        ----------
        core : TPSCoreProperty
            defines core parameters of the (sub-) grid
        continent : str
            acronym of the continent, e.g. 'EU' or 'SA'.
        """

        # load WKT string and extent shape
        data = Equi7Grid._static_data[continent]

        _core = copy.copy(core)
        _core.tag = continent
        _core.projection = TPSProjection(wkt=data['project'])

        # holds core parameters of the (sub-) grid
        self.core = _core

        # holds name of the subgrid
        self.name = ''.join(
            ('EQUI7_', continent, Equi7Grid.encode_sampling(core.sampling), 'M'))

        # holds the extent of the subgrid in the latlon-space
        self.polygon_geog = create_geometry_from_wkt(data['extent'])

        # defines the tilingsystem of the subgrid
        self.tilesys = Equi7TilingSystem(self.core, self.polygon_geog)

        super(Equi7Subgrid, self).__init__(
            self.core, self.polygon_geog, self.tilesys)
Exemplo n.º 3
0
    def __init__(self, core, zone):
        """
        Initialises an UTMSubgrid class for a specified continent.

        Parameters
        ----------
        core : TPSCoreProperty
            defines core parameters of the (sub-) grid
        zone : str
            acronym of the continent, e.g. '01N' or '17S'.
        """

        # load WKT string and extent shape
        data = UTMGrid._static_data[zone]

        _core = copy.copy(core)
        _core.tag = zone
        _core.projection = TPSProjection(proj4=data['proj4'])

        # holds core parameters of the (sub-) grid
        self.core = _core

        # holds name of the subgrid
        self.name = ''.join(
            ('UTMG_', zone, UTMGrid.encode_sampling(core.sampling), 'M'))

        # holds the extent of the subgrid in the latlon-space
        self.polygon_geog = create_geometry_from_wkt(data['zone_extent'])

        # defines the tilingsystem of the subgrid
        self.tilesys = UTMTilingSystem(self.core, self.polygon_geog)

        super(UTMSubgrid, self).__init__(self.core, self.polygon_geog,
                                         self.tilesys)
Exemplo n.º 4
0
    def __init__(self, core, region):
        """
        Initialises an LatLonSubgrid class for a specified continent.
        Parameters
        ----------
        core : TPSCoreProperty
            defines core parameters of the (sub-) grid
        region : str
            acronym of the continent, e.g. 'GL'.
        """

        # load WKT string and extent shape
        data = LatLonGrid._static_data[region]

        _core = copy.copy(core)
        _core.tag = region
        _core.projection = TPSProjection(epsg=4326)

        # holds core parameters of the (sub-) grid
        self.core = _core

        # holds name of the subgrid
        self.name = ''.join(('LATLON_', region, LatLonGrid.encode_sampling(core.sampling)))

        # holds the extent of the subgrid in the latlon-space
        self.polygon_geog = geometry.create_geometry_from_wkt(data['zone_extent'])

        # defines the tilingsystem of the subgrid
        self.tilesys = LatLonTilingSystem(self.core, self.polygon_geog)

        super(LatLonSubgrid, self).__init__(self.core, self.polygon_geog, self.tilesys)