Starter geeViz Folium Viewer Notebook

Example of how to utilize the geeViz’s Folium-based viewer

  • Example of the functionality of Folium-based viewer vs the original geeView viewer

  • In general, the Folium-based viewer is better for a quick look at data on a map, but the geeView viewer works better if you need to query the data and/or need an annimated time lapse

Copyright 2025 Ian Housman

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

github github

# Import modules
####################################################################################################
try:
    import geeViz.getImagesLib as gil
except:
    !python -m pip install geeViz
    import geeViz.getImagesLib as gil


import  geeViz.foliumView as fv
import  geeViz.geeView as gv
ee = gv.ee

# Both have similar objects with similar methods and attributes
foliumViewMap = fv.foliumMapper()
geeViewMap = gv.mapper()

# Set the port
foliumViewMap.port =1234
geeViewMap.port = 1234

# Clear the map 
foliumViewMap.clearMap()
geeViewMap.clearMap()
####################################################################################################
print('done')
done
foliumViewMap.clearMap()
geeViewMap.clearMap()
# Bring in some S2 data
studyArea = ee.Geometry.Polygon(
        [[[-113.21807278537877, 41.786028237932015],
          [-113.21807278537877, 40.595571243156144],
          [-111.82280911350377, 40.595571243156144],
          [-111.82280911350377, 41.786028237932015]]], None, False)

# Get some example images to view
s2s = gil.superSimpleGetS2(studyArea,'2022-01-01','2023-12-31',120,150)
postComposite = s2s.filter(ee.Filter.calendarRange(2023,2023,'year')).median()
foliumViewMap.addLayer(postComposite,gil.vizParamsFalse10k,'S2 Median 2023')
geeViewMap.addLayer(postComposite,gil.vizParamsFalse10k,'S2 Median 2023')
preComposite = s2s.filter(ee.Filter.calendarRange(2022,2022,'year')).median()
foliumViewMap.addLayer(preComposite,gil.vizParamsFalse10k,'S2 Median 2022',False)
geeViewMap.addLayer(preComposite,gil.vizParamsFalse10k,'S2 Median 2022',False)

# Center on the study area and view it
foliumViewMap.centerObject(studyArea)
geeViewMap.centerObject(studyArea)

foliumViewMap.addLayer(studyArea,{'strokeColor':'F00','strokeWidth':5},'Study Area')
geeViewMap.addLayer(studyArea,{'strokeColor':'F00','strokeWidth':5},'Study Area')
####################################################################################################
# Folium-based map currently does not support interacting (querying) the data, while geeView does
geeViewMap.turnOnInspector()

# View the map
foliumViewMap.view()
geeViewMap.view()
Adding layer: S2 Median 2023
Adding layer: S2 Median 2023
Adding layer: S2 Median 2022
Adding layer: S2 Median 2022
Adding layer: Study Area
Adding layer: Study Area
Make this Notebook Trusted to load map: File -> Trust Notebook
Starting webmap
Using default refresh token for geeView
Local web server at: http://localhost:1234/geeView/ already serving.
cwd a:\GEE\gee_py_modules_package\geeViz\examples
geeView URL: http://localhost:1234/geeView/?projectID=lcms-292214&accessToken=ya29.a0AeDClZDbcJ3L1DVXwA-_pCB34jAAAAZNhd7u9i06UHk43hWigYXc3K2oeDYmfRGm-sqiZPXijhaIPwbxQ8ihv0oedNanKny9oGmwSXPjmmpizVz5b6FBSbLqOuLK1kIPLu4v-gbrIry9cu6uJDmYcdS8IY_qOZHpByBppNRjWAkaCgYKATcSARESFQHGX2MiaLWkXlEAlSRFL1yHTKi7Ww0178&accessTokenCreationTime=1731636167610
# Example of how to turn off all layers in each map
foliumViewMap.turnOffAllLayers()
geeViewMap.turnOffAllLayers()

foliumViewMap.view()
geeViewMap.view()
Make this Notebook Trusted to load map: File -> Trust Notebook
Starting webmap
Using default refresh token for geeView
Local web server at: http://localhost:1234/geeView/ already serving.
cwd a:\GEE\gee_py_modules_package\geeViz\examples
geeView URL: http://localhost:1234/geeView/?projectID=lcms-292214&accessToken=ya29.a0AeDClZBgEjF_qT4biuDwvxdtZ3fRkCFXi2hjGPshz4JTMX9Qd_B08sziz8mCa32AnWU1vNHGf20_-D4K_rx5d7KG6Orzca4g73b0wxTGYLjJjlO6q8fMjpkU8ZwD_YM60VL_uDLz4MvtH3FDlI7JjpfyvIRnLYvCnhlIn9ZwZ7QaCgYKARkSARESFQHGX2MiPdRuXvSNF3GQ2UaYanRICw0178&accessTokenCreationTime=1731636205672
# Example of how to turn on all layers in each map
foliumViewMap.turnOnAllLayers()
geeViewMap.turnOnAllLayers()

foliumViewMap.view()
geeViewMap.view()
Make this Notebook Trusted to load map: File -> Trust Notebook
Starting webmap
Using default refresh token for geeView
Local web server at: http://localhost:1234/geeView/ already serving.
cwd a:\GEE\gee_py_modules_package\geeViz\examples
geeView URL: http://localhost:1234/geeView/?projectID=lcms-292214&accessToken=ya29.a0AeDClZBUVPa6LDS25-4BKa-QvyMaz0HTq8mm7-tn5ABvN9VQk-ga6KngwRbFK9lVePwfAnN3KVTzcYhKcl5_a35GszdiHTiYkun9LJ4a_2pwKJu5QwxHQsx9l5rOTV4n5glhvDXYy1-AmDTKKenKabXEY0f1XBVtsZlX4M-j4Z4aCgYKAc4SARESFQHGX2MiTjFdTXxQ6GZsKMtMJgEoVw0178&accessTokenCreationTime=1731636218348