reVX.utilities.utilities.to_geo
- to_geo(data_frame, lat_col='latitude', lon_col='longitude', crs='epsg:4326')[source]
Convert a Pandas DataFrame to a GeoPandas GeoDataFrame.
The input DataFrame must have latitude and longitude columns, which get converted to a point geometry in the outputs GeoDataFrame.
- Parameters:
data_frame (pandas.DataFrame) – A pandas data frame with latitude and longitude coordinates.
lat_col (str, optional) – The name of the latitude column. By default,
"latitude"
.lon_col (str, optional) – The name of the longitude column. By default,
"longitude"
.crs (str, optional) – The Coordinate Reference System of the output DataFrame represented as a string. By default,
"epsg:4326"
.
- Returns:
geopandas.GeoDataFrame – A GeoPandas GeoDataFrame object with points representing the lat/lon positions as the geometry.