34 add points from xy
Uncomment the following line to install leafmap if needed.
In [1]:
Copied!
# !pip install leafmap
# !pip install leafmap
In [2]:
Copied!
import leafmap
import pandas as pd
import leafmap
import pandas as pd
In [3]:
Copied!
# leafmap.update_package()
# leafmap.update_package()
Using a CSV file containing xy coordinates
In [4]:
Copied!
m = leafmap.Map()
data = 'https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/us_cities.csv'
m.add_points_from_xy(data, x="longitude", y="latitude")
m
m = leafmap.Map()
data = 'https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/us_cities.csv'
m.add_points_from_xy(data, x="longitude", y="latitude")
m
Out[4]:
Make this Notebook Trusted to load map: File -> Trust Notebook
Using a Pandas DataFrame containing xy coordinates.
In [5]:
Copied!
m = leafmap.Map()
data = 'https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/us_cities.csv'
df = pd.read_csv(data)
m.add_points_from_xy(df, x="longitude", y="latitude")
m
m = leafmap.Map()
data = 'https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/us_cities.csv'
df = pd.read_csv(data)
m.add_points_from_xy(df, x="longitude", y="latitude")
m
Out[5]:
Make this Notebook Trusted to load map: File -> Trust Notebook
Last update:
2022-03-14