Esempio n. 1
0
    def test_voronoi_spatial_partitioning(self):
        spatial_rdd = LineStringRDD(sparkContext=self.sc,
                                    InputLocation=input_location,
                                    splitter=splitter,
                                    carryInputData=True,
                                    partitions=10,
                                    newLevel=StorageLevel.MEMORY_ONLY)

        spatial_rdd.analyze()
        spatial_rdd.spatialPartitioning(GridType.VORONOI)
        for envelope in spatial_rdd.grids:
            print(envelope)
Esempio n. 2
0
    def test_empty_constructor(self):
        spatial_rdd = LineStringRDD(sparkContext=self.sc,
                                    InputLocation=input_location,
                                    splitter=splitter,
                                    carryInputData=True,
                                    partitions=num_partitions,
                                    newLevel=StorageLevel.MEMORY_ONLY)

        spatial_rdd.analyze()
        spatial_rdd.spatialPartitioning(grid_type)
        spatial_rdd.buildIndex(IndexType.RTREE, True)
        spatial_rdd_copy = LineStringRDD()
        spatial_rdd_copy.rawJvmSpatialRDD = spatial_rdd.rawJvmSpatialRDD
        spatial_rdd_copy.analyze()