Loaders¶
loaders ¶
This module contains loaders, used to load spatial data from different sources.
We want to unify loading from different data sources into a single interface. Thanks to this, we have a unified spatial data format, which makes it possible to feed them into any of the embedding methods available in this library.
Classes¶
- Loader
- GeoparquetLoader
- GTFSLoader
- OSMLoader
- OSMOnlineLoader
- OSMPbfLoader
- OSMTileLoader
- OSMNetworkType
- OSMWayLoader
- OvertureMapsLoader
Functions¶
srai.loaders.convert_to_features_gdf ¶
convert_to_features_gdf(
geometry: Union[
BaseGeometry, Iterable[BaseGeometry], gpd.GeoSeries, gpd.GeoDataFrame
],
index_column: Optional[str] = None,
) -> gpd.GeoDataFrame
Convert any geometry to a features GeoDataFrame.
PARAMETER | DESCRIPTION |
---|---|
geometry
|
Geo objects to convert.
TYPE:
|
index_column
|
Name of the column used to define the index. If None, will rename the existing index. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
GeoDataFrame
|
gpd.GeoDataFrame: Features gdf with proper index definition. |
Source code in srai/geometry.py
srai.loaders.download_file ¶
Download a file with progress bar.
PARAMETER | DESCRIPTION |
---|---|
url
|
URL to download.
TYPE:
|
fname
|
File name.
TYPE:
|
chunk_size
|
Chunk size.
TYPE:
|
force_download
|
Flag to force download even if file exists.
TYPE:
|
Source: https://gist.github.com/yanqd0/c13ed29e29432e3cf3e7c38467f42f51