I/O¶
geoarrow.rust.core ¶
from_ewkb
builtin
¶
from_ewkb(input: ArrowArrayExportable) -> PointArray | LineStringArray | PolygonArray | MultiPointArray | MultiLineStringArray | MultiPolygonArray | MixedGeometryArray | GeometryCollectionArray
Parse an Arrow BinaryArray from EWKB to its GeoArrow-native counterpart.
Parameters:
-
input
(ArrowArrayExportable
) –An Arrow array of Binary type holding EWKB-formatted geometries.
Returns:
-
PointArray | LineStringArray | PolygonArray | MultiPointArray | MultiLineStringArray | MultiPolygonArray | MixedGeometryArray | GeometryCollectionArray
–A GeoArrow-native geometry array
from_wkb
builtin
¶
from_wkb(input: ArrowArrayExportable) -> PointArray | LineStringArray | PolygonArray | MultiPointArray | MultiLineStringArray | MultiPolygonArray | MixedGeometryArray | GeometryCollectionArray
Parse an Arrow BinaryArray from WKB to its GeoArrow-native counterpart.
This expects ISO-formatted WKB geometries.
Parameters:
-
input
(ArrowArrayExportable
) –An Arrow array of Binary type holding WKB-formatted geometries.
Returns:
-
PointArray | LineStringArray | PolygonArray | MultiPointArray | MultiLineStringArray | MultiPolygonArray | MixedGeometryArray | GeometryCollectionArray
–A GeoArrow-native geometry array
from_wkt
builtin
¶
from_wkt(input: ArrowArrayExportable) -> PointArray | LineStringArray | PolygonArray | MultiPointArray | MultiLineStringArray | MultiPolygonArray | MixedGeometryArray | GeometryCollectionArray
Parse an Arrow StringArray from WKT to its GeoArrow-native counterpart.
Parameters:
-
input
(ArrowArrayExportable
) –An Arrow array of string type holding WKT-formatted geometries.
Returns:
-
PointArray | LineStringArray | PolygonArray | MultiPointArray | MultiLineStringArray | MultiPolygonArray | MixedGeometryArray | GeometryCollectionArray
–A GeoArrow-native geometry array
to_wkb
builtin
¶
to_wkb(input: ArrowArrayExportable) -> WKBArray
Encode a GeoArrow-native geometry array to a WKBArray, holding ISO-formatted WKB geometries.
Parameters:
-
input
(ArrowArrayExportable
) –A GeoArrow-native geometry array
Returns:
-
WKBArray
–An array with WKB-formatted geometries
read_csv
builtin
¶
read_csv(path: str, geometry_column_name: str, batch_size: Optional[int] = None) -> GeoTable
Read a CSV file from a path on disk into a GeoTable.
Parameters:
-
path
(str
) –the path to the file
-
geometry_column_name
(str
) –the name of the geometry column within the CSV.
-
batch_size
(Optional[int]
, default:None
) –the number of rows to include in each internal batch of the table.
Returns:
-
GeoTable
–Table from CSV file.
read_flatgeobuf
builtin
¶
read_flatgeobuf(path: str, batch_size: Optional[int] = None) -> GeoTable
read_geojson
builtin
¶
read_geojson(path: str, batch_size: Optional[int] = None) -> GeoTable
read_geojson_lines
builtin
¶
read_geojson_lines(path: str, batch_size: Optional[int] = None) -> GeoTable
read_parquet
builtin
¶
read_parquet(path: str, batch_size: Optional[int] = None) -> GeoTable
write_csv
builtin
¶
write_csv(table: ArrowStreamExportable, path: str) -> GeoTable
Write a GeoTable to a CSV file on disk.
Parameters:
-
table
(ArrowStreamExportable
) –the table to write.
-
path
(str
) –the path to the file.
Returns:
-
GeoTable
–None
write_flatgeobuf
builtin
¶
write_flatgeobuf(table: ArrowStreamExportable, path: str, *, write_index: bool = True) -> GeoTable
Write a GeoTable to a FlatGeobuf file on disk.
Parameters:
-
table
(ArrowStreamExportable
) –the table to write.
-
path
(str
) –the path to the file.
Returns:
-
GeoTable
–None
write_geojson
builtin
¶
write_geojson(table: ArrowStreamExportable, path: str) -> GeoTable
Write a GeoTable to a GeoJSON file on disk.
Note that the GeoJSON specification mandates coordinates to be in the WGS84 (EPSG:4326) coordinate system, but this function will not automatically reproject into WGS84 for you.
Parameters:
-
table
(ArrowStreamExportable
) –the table to write.
-
path
(str
) –the path to the file.
Returns:
-
GeoTable
–None