Beispiel #1
0
 def test_write(self):
     orig = test.geojson(self.path)
     handle, path = tempfile.mkstemp(".geojson")
     orig.write(path)
     data = GeoJSON.read(path)
     assert data == orig
     assert data.metadata == orig.metadata
Beispiel #2
0
def geojson(path):
    path = get_data_path(path)
    return GeoJSON.read(path)
Beispiel #3
0
def read_geojson(path, *, encoding="utf-8", columns=[], dtypes={}, **kwargs):
    return GeoJSON.read(path,
                        encoding=encoding,
                        columns=columns,
                        dtypes=dtypes,
                        **kwargs)
Beispiel #4
0
 def test_read_path(self):
     GeoJSON.read(test.get_data_path(self.path))
Beispiel #5
0
 def test_read_dtypes(self):
     path = str(test.get_data_path(self.path))
     dtypes = {"neighbourhood": object, "neighbourhood_group": object}
     data = GeoJSON.read(path, dtypes=dtypes)
     assert data.neighbourhood.is_object()
     assert data.neighbourhood_group.is_object()
Beispiel #6
0
 def test_read_columns(self):
     path = str(test.get_data_path(self.path))
     data = GeoJSON.read(path, columns=["neighbourhood"])
     assert data.colnames == ["neighbourhood", "geometry"]
Beispiel #7
0
 def test_read(self):
     path = str(test.get_data_path(self.path))
     data = GeoJSON.read(path)
     assert data.nrow == 233
     assert data.ncol == 3