Readers#
The readers module provides functions for reading geospatial data from various sources.
- libadalina_core.readers.csv_to_dataframe(file_path: str, separator=None) DataFrame[source]#
Read a CSV file and return a pandas DataFrame.
- Parameters:
- Returns:
The DataFrame containing the CSV data.
- Return type:
pd.DataFrame
- Raises:
FileNotFoundError – If the specified file does not exist.
- libadalina_core.readers.geopackage_to_dataframe(path: str, layer: str | None = None) GeoDataFrame[source]#
Read a GeoPackage file into a GeoDataFrame.
Geometry is automatically converted to the libadalina default EPSG
DEFAULT_EPSG.- Parameters:
- Returns:
A GeoDataFrame containing the data from the specified layer.
- Return type:
Examples
>>> gdf = geopackage_to_dataframe('data.gpkg', 'layer_name')
- libadalina_core.readers.read_dataset(dataset_path: str) DataFrame | GeoDataFrame | DataFrame[source]#
Read a dataset from a file, supporting both GeoPackage (.gpkg) and CSV (.csv) formats.
- Parameters:
dataset_path (str) – Path to the dataset file
- Returns:
The loaded dataset as a DataFrame
- Return type:
DataFrame