Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to map longitude and latitude in python

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);
Comment

how to map longitude and latitude in python

import matplotlib.pyplot as plt
plt.scatter(x=df['Longitude'], y=df['Latitude'])
plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: execute terminal command from python 
Python :: label change in tkinter 
Python :: oython 
Python :: how to count how many cameras you have with python 
Python :: python generator 
Python :: how to downgrade python 3.9 to 3.8 
Python :: django execute 
Python :: python iterate files 
Python :: progress bar python 
Python :: midpoint 
Python :: python b before string 
Python :: round off to two decimal places python 
Python :: python for character in string 
Python :: encrypt string with key python 
Python :: python read scv 
Python :: test_size 
Python :: findout not common values between two data frames 
Python :: how to pass parameters in python script 
Python :: scipy.cluster.hierarchy 
Python :: how to make python open a program/desktop app 
Python :: python is inf 
Python :: PhoneNumberField django forms 
Python :: flask wtforms multiple select 
Python :: numpy expand_dims 
Python :: primary key auto increment python django 
Python :: user defined functions python 
Python :: python argparse optional required 
Python :: create 8ball command in discord.py 
Python :: how to define piecewise function i python 
Python :: Error: The file/path provided (flaskr) does not appear to exist. Please verify the path is correct. If app is not on PYTHONPATH, ensure the extension is .py 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =