74 csv to points
Uncomment the following line to install geemap if needed.
In [ ]:
Copied!
# !pip install geemap
# !pip install geemap
In [ ]:
Copied!
import os
import geemap
import os
import geemap
In [ ]:
Copied!
# geemap.update_package()
# geemap.update_package()
In [ ]:
Copied!
Map = geemap.Map()
Map
Map = geemap.Map()
Map
In [ ]:
Copied!
in_csv = 'https://raw.githubusercontent.com/giswqs/data/main/world/world_cities.csv'
in_csv = 'https://raw.githubusercontent.com/giswqs/data/main/world/world_cities.csv'
In [ ]:
Copied!
df = geemap.csv_to_df(in_csv)
df
df = geemap.csv_to_df(in_csv)
df
In [ ]:
Copied!
Map.add_xy_data(in_csv, x="longitude", y="latitude", layer_name="csv to ee", to_ee=True)
Map.add_xy_data(in_csv, x="longitude", y="latitude", layer_name="csv to ee", to_ee=True)
In [ ]:
Copied!
fc = geemap.csv_to_ee(in_csv)
fc = geemap.csv_to_ee(in_csv)
In [ ]:
Copied!
Map.addLayer(fc, {}, 'csv to ee 2')
Map.addLayer(fc, {}, 'csv to ee 2')
In [ ]:
Copied!
out_dir = os.path.expanduser('~/Downloads')
if not os.path.exists(out_dir):
os.makedirs(out_dir)
out_shp = os.path.join(out_dir, 'world_cities.shp')
out_dir = os.path.expanduser('~/Downloads')
if not os.path.exists(out_dir):
os.makedirs(out_dir)
out_shp = os.path.join(out_dir, 'world_cities.shp')
In [ ]:
Copied!
geemap.csv_to_shp(in_csv, out_shp)
geemap.csv_to_shp(in_csv, out_shp)
In [ ]:
Copied!
out_geojson = os.path.join(out_dir, 'world_cities.geojson')
geemap.csv_to_geojson(in_csv, out_geojson)
out_geojson = os.path.join(out_dir, 'world_cities.geojson')
geemap.csv_to_geojson(in_csv, out_geojson)
In [ ]:
Copied!
gdf = geemap.csv_to_gdf(in_csv)
gdf
gdf = geemap.csv_to_gdf(in_csv)
gdf
In [ ]:
Copied!
Map.add_xy_data(in_csv, x="longitude", y="latitude", layer_name="Marker cluster")
Map
Map.add_xy_data(in_csv, x="longitude", y="latitude", layer_name="Marker cluster")
Map
Last update:
2023-04-06
Created: 2020-06-29
Created: 2020-06-29