Skip to content

CSV

Read and write CSV files with a geometry column encoded as Well-Known Text.

geoarrow.rust.io.read_csv

read_csv(
    file: str | Path | BinaryIO,
    geometry_column_name: str,
    *,
    batch_size: int = 65536
) -> Table

Read a CSV file from a path on disk into a Table.

Parameters:

  • file (str | Path | BinaryIO) –

    the path to the file or a Python file object in binary read mode.

  • geometry_column_name (str) –

    the name of the geometry column within the CSV.

  • batch_size (int, default: 65536 ) –

    the number of rows to include in each internal batch of the table.

Returns:

  • Table

    Table from CSV file.

geoarrow.rust.io.write_csv

write_csv(table: ArrowStreamExportable, file: str | Path | BinaryIO) -> None

Write a Table to a CSV file on disk.

Parameters:

  • table (ArrowStreamExportable) –

    the Arrow RecordBatch, Table, or RecordBatchReader to write.

  • file (str | Path | BinaryIO) –

    the path to the file or a Python file object in binary write mode.

Returns:

  • None

    None