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
def geojson(path): path = get_data_path(path) return GeoJSON.read(path)
def read_geojson(path, *, encoding="utf-8", columns=[], dtypes={}, **kwargs): return GeoJSON.read(path, encoding=encoding, columns=columns, dtypes=dtypes, **kwargs)
def test_read_path(self): GeoJSON.read(test.get_data_path(self.path))
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()
def test_read_columns(self): path = str(test.get_data_path(self.path)) data = GeoJSON.read(path, columns=["neighbourhood"]) assert data.colnames == ["neighbourhood", "geometry"]
def test_read(self): path = str(test.get_data_path(self.path)) data = GeoJSON.read(path) assert data.nrow == 233 assert data.ncol == 3