ImageOverlay or TileLayer with local files
See original GitHub issueI was trying the Velocity demo with a smaller wind dataset and would like to add a local file rasters (higher quality terrain hillshade) or a local Tilemap I created with QGIS to the map. Those files are on a different drive though, and I can´t figure out how to get them to display. It seems absolute paths don´t work even if I try it with the same file I use for the relative path:
# png is in the same folder as the notebook
# works
rel_url = './IPy_header.png'
io1 = ImageOverlay(url=rel_url, bounds=m.bounds)
m.add_layer(io1)
# does not work
abs_url = 'file:///E:/JUPYTER/Velocity/IPy_header.png'
io2 = ImageOverlay(url=abs_url, bounds=m.bounds)
m.add_layer(io2)
How can I point to a local file or a Tilemap and get it to display?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:23 (11 by maintainers)
Top Results From Across the Web
How I can load tileLayer in Leaflet framework using local tiles?
How do you load a GeoJSON file in Leaflet? 1 · Use Lambert 93 imageOverlay with Leaflet on top of OSM tiles layer...
Read more >Local Tile Layer — ipyleaflet documentation
LocalTileLayer class. Custom tile layer using local tile files. path#. Path to your local tiles. In the classic Jupyter Notebook ...
Read more >Leaflet library doesn't work for adding image on the map
The culprit is (at least) var imageUrl = 'C:/etna.jpg' . Browsers will prevent you from loading files from the local File System for...
Read more >leafmap module
class ImageOverlay(ipyleaflet.ImageOverlay): """ImageOverlay class. Args: url (str): http URL or local file path to the image. bounds (tuple): bounding box ...
Read more >Plugins - Leaflet - a JavaScript library for interactive maps
Display small and large GeoTIFF files with configurable resolution. ... A simple WMTS Tile Layer plugin for Leaflet. ... A TileLayer for GeoJSON...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thought I’d chime in and give a plug for something I developed to solve the issue of viewing local raster files with ipyleaflet: https://github.com/banesullivan/localtileserver
In essence, it’s a little package that will launch a local tile server in a background thread for use with ipyleaflet. Check out the README for an example, (the code here is subject to change):
The discussion is drifting away from the original purpose of the issue.
Would you mind opening another issue or ask your question on another channel?