Пример #1
0
 def load(cls, sc: SparkContext, path: str) -> SpatialRDD:
     jvm = sc._jvm
     line_string_rdd = LineStringRDD()
     srdd = SpatialObjectLoaderAdapter(jvm).load_line_string_spatial_rdd(
         sc._jsc, path)
     line_string_rdd.set_srdd(srdd)
     return line_string_rdd
    def readToLineStringRDD(cls, sc: SparkContext,
                            inputPath: str) -> LineStringRDD:
        """

        :param sc:
        :param inputPath:
        :return:
        """
        jvm = sc._jvm
        jsc = sc._jsc
        srdd = jvm.ShapefileReader.readToLineStringRDD(jsc, inputPath)
        spatial_rdd = LineStringRDD()
        spatial_rdd.set_srdd(srdd)
        return spatial_rdd
Пример #3
0
 def getCenterLineStringRDDAsSpatialRDD(self) -> 'LineStringRDD':
     from sedona.core.SpatialRDD import LineStringRDD
     srdd = self._srdd.getCenterPolygonAsSpatialRDD()
     linestring_rdd = LineStringRDD()
     linestring_rdd.set_srdd(srdd)
     return linestring_rdd