-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More convenient methods to get basemaps from MapTiles/Tyler (potentially write to an RGB raster, etc) #37
Comments
What is the use case for this? Is it to be able to save the tiles in some local file so that it is possible to plot the basemap without internet connection? I am wondering whether it would make sense to fetch all zoomlevels below a given zoom level and to build a Pyramid out of them. |
The idea would be to return a That being said, we should definitely support downloading pyramids for local use. Does PyramidScheme support saving to file? |
I am currently working on saving to zarr but that cant be read by Rasters yet. I might look into saving to geotiff. |
Pretty easy to add Zarr support to Rasters now with https://github.com/JuliaGeo/ZarrDatasets.jl |
@asinghvi17 we could add a RastersMapTilesExt extension for Rasters.jl like for RasterDataSources.jl Then we can just use the normal constructor syntax but with a provider instead of a file name, and extra keywords: Raster(provider; extent, [zoomlevel, size, res]) We should also be able to use any Raster/Extexts/GeoInterface object for the extent keyword. Having |
That should work nicely! Does Rasters have any image loading dependencies? |
No, but probly gdal can do it 😱 |
The horror |
I opened a PR for Rasters to add ZarrDatasetsExt. |
Should this functionality live her or in TileProviders? I don't understand the boundaries of these packages but saw, that you opened a similar issue on TileProviders. |
Huh, I completely forgot about that. I think that implementing it either in an extension on Rasters here or as an extension on MapTiles in Rasters would be the way to go. The only thing is that we would need some form of image loading library, which might be a pain. ImageIO could probably handle it, and is a Makie dependency so would get automatically pulled in most of the time anyway. |
I just wrote a basic script that does this at https://gist.github.com/asinghvi17/cfc8266bc084bc55678c87b5d14dcbc9. It needs HTTP.jl and ImageMagick.jl though, so it may be best to make this a separate package...I'm not sure how we would name it though. Alternatively, the code could sit in Tyler, since it has all of those dependencies, and then Rasters could implement an extension on Tyler which just dimensionalizes the (x, y, z) output of the function. |
Pushed a PR (MakieOrg/Tyler.jl#89) to Tyler along with some conversion methods so you can plot |
Reopening, because it's come under discussion that we should maybe:
If this all lives in MapTiles, then it becomes extremely easy to work with map tiles. We might be able to add the parts of the downloaders that need e.g ImageIO or ArchGDAL in extensions, and then only need to depend on DiskArrays. What do folks here think? cc @felixcremer @lazarusA who brought this up. |
I'd be fine with adding download support if that makes things easier. If in the future it somehow turns out that we need a separate package like the original MapTiles we could always make a subpackage in this repository. |
I really like this option. Make MapTiles.jl a bit more useful and avoid the Makie dep for non plotting use cases. A DiskArrays extension is a good idea too. Then Tyler.jl can call the download API from here and be more about plotting. (And yes as @visr says we can always add MapTilesCore.jl if we need it) |
This would probably be best put in the MapTiles.jl repo, but might also go into Tyler if we need Tyler's dependencies. I envision the method to be something like:
The text was updated successfully, but these errors were encountered: