In [5]:
# In order for this notebook to work, it assumes two things:
#
# 1. You have ingested source elevation data into MrGeo, giving
#    if the name "small-elevation". If you ingest to a different
#    name, be sure to change the code in this notebook accordingly.
# 2. You have the MrGeo web services running on the localhost. You
#    can run "mrgeo webserver" on the command line to start a standalone
#    isntance of the MrGeo web services for this purpose.

from pymrgeo import MrGeo
import folium
from folium import plugins
from folium.features import WmsTileLayer

mrgeo = MrGeo()
mrgeo.usedebug()
mrgeo.start()
try:
    output_name = "test-slope-9"
    elev = mrgeo.load_image("small-elevation")
    slope_deg = elev.slope("deg")
    slope_deg.save(output_name)
    slope_deg_2 = mrgeo.load_image(output_name)
    slope_deg_2.buildpyramid()

finally:
    mrgeo.stop()

map_osm = folium.Map(location=[-18, 142],
                     crs='EPSG3857',
#                      crs='EPSG4326',
                     tiles='OpenStreetMap')
wms_layer = WmsTileLayer('http://localhost:8080/mrgeo/wms', name='MrGeo',
                             format='image/png',
                             layers=output_name,
                             styles='rainbow',
                             overlay=True,
                             transparent=True, control=True)
map_osm.add_child(wms_layer)
map_osm.add_child(folium.LayerControl())
map_osm


Initializing gateway
Talking with MrGeo on port 25333
Out[5]: