Exemplo n.º 1
0
 def test_read_to_point_rdd(self):
     input_location = os.path.join(tests_path, "resources/shapefiles/point")
     spatial_rdd = ShapefileReader.readToPointRDD(self.sc, input_location)
     geometry_rdd = ShapefileReader.readToGeometryRDD(
         self.sc, input_location)
     window = Envelope(-180.0, 180.0, -90.0, 90.0)
     count = RangeQuery.SpatialRangeQuery(spatial_rdd, window, False,
                                          False).count()
     assert spatial_rdd.rawSpatialRDD.count() == count
     assert 'org.datasyslab.geospark.spatialRDD.SpatialRDD' in geometry_rdd._srdd.toString(
     )
     assert 'org.datasyslab.geospark.spatialRDD.PointRDD' in spatial_rdd._srdd.toString(
     )
Exemplo n.º 2
0
    def test_shape_file_end_with_undefined_type(self):
        shape_rdd = ShapefileReader.readToGeometryRDD(
            sc=self.sc, inputPath=undefined_type_shape_location)

        if is_greater_or_equal_version(GeoSparkMeta.version, "1.2.0"):
            assert shape_rdd.fieldNames == [
                'LGA_CODE16', 'LGA_NAME16', 'STE_CODE16', 'STE_NAME16',
                'AREASQKM16'
            ]
        assert shape_rdd.getRawSpatialRDD().count() == 545
Exemplo n.º 3
0
 def test_read_geometry_rdd(self):
     shape_rdd = ShapefileReader.readToGeometryRDD(self.sc,
                                                   polygon_shape_location)
     assert shape_rdd.fieldNames == []
     assert shape_rdd.rawSpatialRDD.collect().__len__() == 10000