def load(cls, sc: SparkContext, path: str) -> SpatialRDD: jvm = sc._jvm polygon_rdd = PolygonRDD() srdd = SpatialObjectLoaderAdapter(jvm).load_polygon_spatial_rdd( sc._jsc, path) polygon_rdd.set_srdd(srdd) return polygon_rdd
def readToPolygonRDD(cls, sc: SparkContext, inputPath: str) -> PolygonRDD: """ :param sc: :param inputPath: :return: """ jvm = sc._jvm jsc = sc._jsc srdd = jvm.ShapefileReader.readToPolygonRDD(jsc, inputPath) spatial_rdd = PolygonRDD() spatial_rdd.set_srdd(srdd) return spatial_rdd
def getCenterPolygonAsSpatialRDD(self) -> 'PolygonRDD': from sedona.core.SpatialRDD import PolygonRDD srdd = self._srdd.getCenterPolygonAsSpatialRDD() polygon_rdd = PolygonRDD() polygon_rdd.set_srdd(srdd) return polygon_rdd