Published
- 1 min read
how to map longitude and latitude in python
The solution for this is noted below
how to map longitude and latitude in python
Solution
from shapely.geometry import Point
import geopandas as gpd
from geopandas import GeoDataFrame
df = pd.read_csv("Long_Lats.csv", delimiter=',', skiprows=0, low_memory=False)
geometry = [Point(xy) for xy in zip(df['Longitude'], df['Latitude'])]
gdf = GeoDataFrame(df, geometry=geometry)
#this is a simple map that goes with geopandas
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
gdf.plot(ax=world.plot(figsize=(10, 6)), marker='o', color='red', markersize=15);
Try other methods by searching on the site. That is if this doesn’t work