exactextract.writer

Classes

Writer

Writes the results of summary operations to a desired format

JSONWriter

Creates GeoJSON-like features

PandasWriter

Creates a (Geo)Pandas DataFrame

QGISWriter

Creates QGSVectorLayer

GDALWriter

Writes results using GDAL/OGR

Module Contents

class exactextract.writer.Writer[source]

Writes the results of summary operations to a desired format

class exactextract.writer.JSONWriter(*, array_type: str = 'numpy', map_fields: Mapping[str, Tuple[str]] | None = None)[source]

Creates GeoJSON-like features

Parameters:
  • array_type – type that should be used to represent array outputs. either “numpy” (default), “list”, or “set”

  • map_fields – an optional dictionary of fields to be created by interpreting one field as keys and another as values, in the format { dst_field : (src_keys, src_vals) }. for example, the fields “values” and “frac” would be combined into a field called “frac_map” using map_fields = {"frac_map": ("values", "frac")}.

add_operation(op)[source]
write(feature)[source]
features()[source]
class exactextract.writer.PandasWriter(*, srs_wkt=None)[source]

Creates a (Geo)Pandas DataFrame

add_operation(op)[source]
add_column(col_name)[source]
add_geometry()[source]
write(feature)[source]
features()[source]
class exactextract.writer.QGISWriter(*, srs_wkt=None)[source]

Creates QGSVectorLayer

add_operation(op)[source]
add_column(col_name)[source]
write(feature)[source]
features()[source]
class exactextract.writer.GDALWriter(dataset=None, *, filename=None, driver=None, layer_name='', srs_wkt=None)[source]

Writes results using GDAL/OGR

Parameters:
  • dataset – a gdal.Dataset or ogr.DataSource to which results should be created in a new layer

  • filename – file to write results to, if dataset is None

  • driver – driver to use when creating filename

  • layer_name – name of new layer to create in output dataset

  • srs_wkt – spatial reference system to assign to output dataset. No coordinate transformation will be performed.

add_operation(op)[source]
add_column(col_name)[source]
write(feature)[source]
features()[source]