How to use the pytileproj.base.TiledProjection function in pytileproj

To help you get started, we’ve selected a few pytileproj examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TUW-GEO / Equi7Grid / equi7grid / equi7grid.py View on Github external
long form of the tilename containing the lon-lat position
        i : integer
            pixel column number; starts with 0
        j : integer
            pixel row number; starts with 0

        """
        # get the xy-coordinates
        subgrid, x, y = self._lonlat2xy(lon, lat)

        tilename, i, j = self.subgrids[str(subgrid)].tilesys.xy2ij_in_tile(x, y, lowerleft=lowerleft)

        return tilename, i, j


class Equi7Subgrid(TiledProjection):
    """
    Equi7Subgrid class object, inheriting TiledProjection() from pytileproj.

    """

    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'.
        """
github TUW-GEO / Equi7Grid / equi7grid / copernicusgrid.py View on Github external
msg += " Supported resolutions: {}".format(
                str(CopernicusGrid._static_res))
            raise ValueError(msg)

        return tile_code

    def get_tilesize(self, sampling):
        xsize = {'T10': 10.0, 'GLOBAL': 360.0}[self.get_tiletype(sampling)]
        ysize = {'T10': 10.0, 'GLOBAL': 180.0}[self.get_tiletype(sampling)]
        return xsize, ysize

    def create_tile(self, name):
        pass


class CopernicusSubgrid(TiledProjection):

    def __init__(self, core, continent):

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

        self.core = _core
        self.polygon_geog = bbox2polygon([(-179.9999999, -90.0), (179.9999999, 90.0)],
                                         self.core.projection.osr_spref)
        self.tilesys = CopernicusTilingSystem(self.core, self.polygon_geog)

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


    def get_polygon(self):