Comments (6)
Following @gjoseph92 's suggestion, I changed the relevant code in the xarray_leaflet.py and it is now finally working in my Jupyterlab (3.0.16).
Thank you @gjoseph92. Saved my day trying to figure out what went wrong in my conda environment.
from xarray_leaflet.
I'm imagine missing something here, but is the goal of the "find the base URL" logic to figure out the URL of the Jupyter server? In that case, would something like
url = urllib.parse.urlparse(m.window_url) self.base_url = f"{url.scheme}://{url.netloc}"work for all the cases in general?
Sorry for not replying earlier @gjoseph92, in your particular case self.base_url
would be http://localhost:8888
if I use your logic. What we need is the Jupyter Server base URL, because the tiles are served by the Server. So your suggestion wouldn't work when used through Binder for instance, because it adds a prefix to the URL.
The current implementation is wrong, but I couldn't come up with an acceptable solution yet. If you have ideas, please don't hesitate to share.
from xarray_leaflet.
Correct, what I posted doesn't work in generality (particularly Binder). For stackstac, I ended up going with this regex which works fine, though I don't love that it's specific to lab
/notebook
/voila
. Seems like the most correct approach would be to pull it from the NotebookApp.base_config
option, or from the frontend.
Also @davidbrochart you might be interested in stackstac.show
. I took a bit of inspiration from xarray-leaflet, though the implementation is more optimized for concurrency with dask. At some point I'd like to pull this into a separate package and maybe combine with xarray-leaflet, but that's not realistic until there's some package to put common xarray geospatial operations in (xref gjoseph92/stackstac#50, maybe geoxarray someday)—currently, there's too much shared code between stackstac.show
and core stackstac
to really pull it out.
from xarray_leaflet.
Thanks for sharing your work on stackstac, it looks interesting!
Looking at the limitations about visualization, I can see that "resolution doesn’t change as you zoom in or out". I'm not sure what this means, isn't the data somehow aggregated, as it is in xarray-leaflet?
from xarray_leaflet.
Ah no, all I meant is that
zooming in and out will not load underlying data at different resolutions. Assets will be loaded at whatever resolution you initially got from
stack
. If your array is large and high-resolution, zooming out could trigger very slow (and expensive) computations.
https://stackstac.readthedocs.io/en/latest/api/main.html#visualization
This is a limitation of xarray-leaflet as well. It should be possible to get around with some clever dask graph rewriting, but I won't get to that for a while.
from xarray_leaflet.
See #45
from xarray_leaflet.
Related Issues (20)
- can't see data on map HOT 3
- Default CRS and nodata
- Interact with extra dimensions
- How to render xarray_leaflet with voila? E.g. $ voila xarray_interact.ipynb HOT 4
- Attribute error on open_rasterio function
- No data display HOT 5
- No data display HOT 10
- are you considering releasing the colormap ? HOT 2
- Tile URL management HOT 5
- Zarr support HOT 20
- Colorbar does not show if dynamic=False
- Renamed default branch to main
- DataArrays that aren't in lat-lon co-ordinates: are they supported? HOT 3
- is it possible to filter out some values when using the plot function ?
- Extra install for vector support
- Hierarchical arrays
- module 'xarray.core' has no attribute 'rolling' HOT 1
- Installing xarray-leaflet causes jupyter server to be really slow to start HOT 9
- LocalTileLayer does not appear on map HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xarray_leaflet.