gemgis.utils.read_csv_as_gdf
gemgis.utils.read_csv_as_gdf#
- gemgis.utils.read_csv_as_gdf(path: str, crs: Union[str, pyproj.crs.crs.CRS], x: str = 'X', y: str = 'Y', z: str = None, delimiter: str = ',') geopandas.geodataframe.GeoDataFrame#
Reading CSV files as GeoDataFrame
- Parameters
path (str) – Path of the CSV files, e.g.
path='file.csv'crs (Union[str, pyproj.crs.crs.CRS]) – CRS of the spatial data, e.g.
crs='EPSG:4647'x (str) – Name of the X column, e.g.
x='X', default is'X'y (str) – Name of the Y column, e.g.
y='Y', default is'Y'z (str) – Name of the Z column, e.g.
z='Z', default is'Z'delimiter (str) – Delimiter of CSV file, e.g.
delimiter=',', default is ‘,’
- Returns
gdf – GeoDataFrame of the CSV data
- Return type
gpd.geodataframe.GeoDataFrame
New in version 1.0.x.
Example
>>> # Loading Libraries and File as GeoDataFrame >>> import gemgis as gg >>> gdf = gg.utils.read_csv_as_gdf(path='file.csv') >>> gdf id formation geometry 0 None Ton POINT (19.150 293.313) 1 None Ton POINT (61.934 381.459) 2 None Ton POINT (109.358 480.946) 3 None Ton POINT (157.812 615.999) 4 None Ton POINT (191.318 719.094)