How to use pyrasterframes - 1 common examples

To help you get started, we’ve selected a few pyrasterframes 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 locationtech-labs / geopyspark / geopyspark / geotrellis / layer.py View on Github external
Args:
            num_bands (int): The number of bands the ``TiledRasterLayer`` has.

        Returns:
            :class:`~geopyspark.geotrellis.layer.TiledRasterLayer`
        """

        try:
            from pyrasterframes import RasterFrame
        except ImportError:
            raise ImportError("pyrasterframes must be installed in order to use the to_rasterframe method")

        rf_context = get_spark_context()._rf_context

        if rf_context:
            return RasterFrame(rf_context._jrfctx.asRF(self.srdd.rdd(), num_bands), rf_context._spark_session)
        else:
            raise AttributeError("RasterFrames has not been enabled in the active SparkSession")

pyrasterframes

Access and process geospatial raster data in PySpark DataFrames

Apache-2.0
Latest version published 2 years ago

Package Health Score

54 / 100
Full package analysis

Popular pyrasterframes functions

Similar packages