Basic Mapping
Basic Interactive Mapping with hagerstrand¶
In [8]:
import hagerstrand as hs
import ee
In [9]:
# Create interactive map with hagerstrand
Map_hs = hs.Map(center=[23.1291,113.2644], zoom=4)
In [10]:
# Initialize Earth Engine
hs.ee_initialize()
In [11]:
# Center map
Map_hs = hs.Map(center=[35.9606,-83.9207], zoom=10)
In [12]:
Map_hs
Add a file to an interactive map¶
In [11]:
from IPython.display import Video
Video(r"../../examples/videos/Add_File.mp4", height=500, width=750)
Out[11]:
Change basemap¶
In [12]:
Video(r"../../examples/videos/Change_Basemap.mp4", height=500, width=750)
Out[12]:
In [7]:
# Add geojson to map
#Map_hs.add_geojson("../../examples/data/cbg_poi_lines.json", layer_name="CBG to POI")
Basic Interactive Mapping with geemap¶
In [13]:
import geemap
In [14]:
# Initialize Earth Engine
geemap.ee_initialize()
# Create interactive map with geemap
Map_gee = geemap.Map(center=[23.1291,113.2644], zoom=4)
In [15]:
# Add basemap
Map_gee.add_basemap('Esri Transportation') # Esri Transportation
In [16]:
# Focus on Guangzhou area
geometry = ee.Geometry.Polygon(
[[[113.2644,25.1291],
[113.2644,23.1291],
[111.2644,21.1291],
[114.2644,23.1291]]])
Map_gee.centerObject(ee.FeatureCollection(geometry), 10)
In [17]:
# Adding a feature of China
countries = ee.FeatureCollection("USDOS/LSIB_SIMPLE/2017")
country = countries.filter(ee.Filter.eq('country_na', 'China'))
Map_gee.addLayer(country, { 'color': 'red' }, 'feature')
In [18]:
Map_gee
In [14]:
#Map.setCenter(-74.0080, 40.637, 16) # I think the best egg tarts in NYC are at Xinfa Bakery in Brooklyn's Chinatown :-)
Last update: 2021-05-03