示例#1
0
    def compare_count(self, spatial_rdd: LineStringRDD, envelope: Envelope,
                      count: int):

        spatial_rdd.analyze()

        assert count == spatial_rdd.approximateTotalCount
        assert envelope == spatial_rdd.boundaryEnvelope
示例#2
0
    def test_build_index_without_set_grid(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.buildIndex(IndexType.RTREE, False)
示例#3
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)
示例#4
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()