dataiter.GeoJSON

__init__() read() to_data_frame() write()

class dataiter.GeoJSON(*args, **kwargs)[source]

A class for GeoJSON data.

GeoJSON is a simple wrapper class that reads GeoJSON features into a DataFrame. Any operations on the data are thus done with methods provided by the data frame class. Geometry is available in the “geometry” column, but no special geometric operations are supported. All other data is available in the “metadata” attribute as an attd.AttributeDict.

__init__(*args, **kwargs)[source]

Return a new GeoJSON object.

args and kwargs are like for dict.

https://docs.python.org/3/library/stdtypes.html#dict

classmethod read(path, *, encoding='utf-8', columns=[], dtypes={}, **kwargs)[source]

Return data from GeoJSON file path.

Will automatically decompress if path ends in .bz2|.gz|.xz. columns is an optional list of columns to limit to. dtypes is an optional dict mapping column names to NumPy datatypes. kwargs are passed to json.load.

to_data_frame(drop_geometry=False)[source]

Return GeoJSON converted to a regular data frame.

write(path, *, encoding='utf-8', **kwargs)[source]

Write data to GeoJSON file path.

Will automatically compress if path ends in .bz2|.gz|.xz. kwargs are passed to json.dumps.