Raster
In [ ]:
Copied!
from ipyleaflet import Map, ImageOverlay
m = Map(center=(25, -115), zoom=4)
image = ImageOverlay(
url="https://i.imgur.com/06Q1fSz.png",
# url='../06Q1fSz.png',
bounds=((13, -130), (32, -100)),
)
m.add(image)
m
from ipyleaflet import Map, ImageOverlay
m = Map(center=(25, -115), zoom=4)
image = ImageOverlay(
url="https://i.imgur.com/06Q1fSz.png",
# url='../06Q1fSz.png',
bounds=((13, -130), (32, -100)),
)
m.add(image)
m
In [ ]:
Copied!
import geohey
import geohey
In [ ]:
Copied!
m = geohey.Map()
url = "https://i.gifer.com/4j.gif"
# url='../06Q1fSz.png',
bounds = ((13, 100), (45, 130))
m.add_image(url, bounds)
m.add_layers_control()
# m.scroll_wheel_zoom = True
m
m = geohey.Map()
url = "https://i.gifer.com/4j.gif"
# url='../06Q1fSz.png',
bounds = ((13, 100), (45, 130))
m.add_image(url, bounds)
m.add_layers_control()
# m.scroll_wheel_zoom = True
m
In [ ]:
Copied!
import rasterio
import pyproj
print(f"Rasterio version: {rasterio.__version__}")
print(f"GDAL version: {rasterio.__gdal_version__}")
print(f"Pyproj version: {pyproj.__version__}")
import rasterio
import pyproj
print(f"Rasterio version: {rasterio.__version__}")
print(f"GDAL version: {rasterio.__gdal_version__}")
print(f"Pyproj version: {pyproj.__version__}")
In [ ]:
Copied!
_pyproj_global_context_initialize()
_pyproj_global_context_initialize()
In [ ]:
Copied!
import os
os.environ['PROJ_LIB'] = os.path.join(os.getenv('CONDA_PREFIX'), 'share', 'proj', 'pyproj')
import os
os.environ['PROJ_LIB'] = os.path.join(os.getenv('CONDA_PREFIX'), 'share', 'proj', 'pyproj')
In [ ]:
Copied!
import pyproj
import pyproj
In [ ]:
Copied!
from pyproj import CRS
import warnings
# Suppress specific warnings related to pyproj database path issues
warnings.filterwarnings("ignore", message="pyproj unable to set database path")
try:
crs = CRS.from_epsg(4326) # WGS 84
print(crs)
except Exception as e:
print(f"Pyproj Error: {e}")
from pyproj import CRS
import warnings
# Suppress specific warnings related to pyproj database path issues
warnings.filterwarnings("ignore", message="pyproj unable to set database path")
try:
crs = CRS.from_epsg(4326) # WGS 84
print(crs)
except Exception as e:
print(f"Pyproj Error: {e}")
In [ ]:
Copied!
from localtileserver import TileClient, get_leaflet_tile_layer, examples
from ipyleaflet import Map
# Create a TileClient from a raster file
# client = TileClient('path/to/geo.tif')
client = examples.get_san_francisco() # use example data
# Create ipyleaflet TileLayer from that server
t = get_leaflet_tile_layer(client)
# Create ipyleaflet map, add tile layer, and display
m = Map(center=client.center(), zoom=client.default_zoom)
m.add(t)
m
from localtileserver import TileClient, get_leaflet_tile_layer, examples
from ipyleaflet import Map
# Create a TileClient from a raster file
# client = TileClient('path/to/geo.tif')
client = examples.get_san_francisco() # use example data
# Create ipyleaflet TileLayer from that server
t = get_leaflet_tile_layer(client)
# Create ipyleaflet map, add tile layer, and display
m = Map(center=client.center(), zoom=client.default_zoom)
m.add(t)
m
In [ ]:
Copied!
m.layers
m.layers
In [ ]:
Copied!
from localtileserver import TileClient, get_leaflet_tile_layer, examples
from ipyleaflet import Map
# Create a TileClient from a raster file
# client = TileClient('srtm90.tif')
client = TileClient(
"https://github.com/opengeos/datasets/releases/download/raster/srtm90.tif"
)
# client = TileClient('https://opendata.digitalglobe.com/events/california-fire-2020/pre-event/2018-02-16/pine-gulch-fire20/1030010076004E00.tif')
# client = examples.get_san_francisco() # use example data
# Create ipyleaflet TileLayer from that server
t = get_leaflet_tile_layer(client, colormap="terrain")
# Create ipyleaflet map, add tile layer, and display
m = Map()
m.add(t)
m.center = client.center()
m.zoom = client.default_zoom
m
from localtileserver import TileClient, get_leaflet_tile_layer, examples
from ipyleaflet import Map
# Create a TileClient from a raster file
# client = TileClient('srtm90.tif')
client = TileClient(
"https://github.com/opengeos/datasets/releases/download/raster/srtm90.tif"
)
# client = TileClient('https://opendata.digitalglobe.com/events/california-fire-2020/pre-event/2018-02-16/pine-gulch-fire20/1030010076004E00.tif')
# client = examples.get_san_francisco() # use example data
# Create ipyleaflet TileLayer from that server
t = get_leaflet_tile_layer(client, colormap="terrain")
# Create ipyleaflet map, add tile layer, and display
m = Map()
m.add(t)
m.center = client.center()
m.zoom = client.default_zoom
m
In [ ]:
Copied!
In [7]:
Copied!
import athigeo
import athigeo
The Kernel crashed while executing code in the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click <a href='https://aka.ms/vscodeJupyterKernelCrash'>here</a> for more info. View Jupyter <a href='command:jupyter.viewOutput'>log</a> for further details.
In [3]:
Copied!
m = athigeo.Map(add_layer_control=False)
data = "https://github.com/opengeos/datasets/releases/download/raster/srtm90.tif"
m.add_raster(data, colormap ="terrain", name="DEM")
m
m = athigeo.Map(add_layer_control=False)
data = "https://github.com/opengeos/datasets/releases/download/raster/srtm90.tif"
m.add_raster(data, colormap ="terrain", name="DEM")
m
Out[3]:
Map(center=[37.630466999999996, -119.03021849999999], controls=(ZoomControl(options=['position', 'zoom_in_text…
In [6]:
Copied!
m.layers[1].interact(opacity=(0.0, 1.0, 0.1))
m.layers[1].interact(opacity=(0.0, 1.0, 0.1))
Out[6]:
Box(children=(FloatSlider(value=0.8, description='opacity', max=1.0),))
In [ ]:
Copied!
m.layers
m.layers
In [ ]:
Copied!
client.center()
client.center()
In [ ]:
Copied!
client.default_zoom
client.default_zoom
In [ ]:
Copied!
In [ ]:
Copied!
In [ ]:
Copied!
In [ ]:
Copied!
m.layers
m.layers
In [ ]:
Copied!