Tyler.jl icon indicating copy to clipboard operation
Tyler.jl copied to clipboard

Add a function `basemap` to get a static image from Tyler, and some converts for image

Open asinghvi17 opened this issue 1 year ago • 10 comments
trafficstars

This file provides the ability to get static base maps from Tyler.

Its main entry point is the basemap function, which returns a tuple (x, y, z) of the image data (z) and its axes (x and y). The image is in a web-mercator CRS, we need to figure out a way to also get eg WGS84 tiles.

This file also contains definitions for convert_arguments that make the following syntax "just work":

image(TileProviders.Google(), Rect2f(-0.0921, 51.5, 0.04, 0.025), (1000, 1000); axis= (; aspect = DataAspect()))

You do still have to provide the extent and image size, but this is substantially better than nothing.

asinghvi17 avatar Jul 09 '24 08:07 asinghvi17

(This doesn't work now but will work with #90, since that imports FileIO)

asinghvi17 avatar Jul 09 '24 09:07 asinghvi17

Is there a reason basemap isn't in MapTiles.jl ?

Would let other packages skip the Makie dep

rafaqz avatar Jul 09 '24 12:07 rafaqz

HTTP.jl and ImageIO.jl are required to stitch the tiles together, but if those can go in MapTiles I'm fine to upstream this

asinghvi17 avatar Jul 09 '24 12:07 asinghvi17

Ahh right. Might be worth it for Plots.jl uses

rafaqz avatar Jul 09 '24 13:07 rafaqz

This will have to be reimplemented based off #95

asinghvi17 avatar Aug 03 '24 11:08 asinghvi17

please add these lines at the end of our .css file

/* Component: Docstring Custom Block */

.jldocstring.custom-block {
  border: 1px solid var(--vp-c-gray-2);
  color: var(--vp-c-text-1)
}

.jldocstring.custom-block summary {
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  margin: 0 0 8px;
}
Screenshot 2024-09-26 at 18 30 35

Edit: Also, it looks like your examples are not working.

lazarusA avatar Sep 26 '24 16:09 lazarusA

This one also looks like a lot of work has already been put into it. How do we move forward with this, or decide not to?

lazarusA avatar Dec 23 '24 13:12 lazarusA

I think we want to factor a bunch of stuff out of Tyler and put it in MapTiles....

asinghvi17 avatar Dec 23 '24 14:12 asinghvi17

@asinghvi17 a lot of work went into this already? did things split out somewhere else, or should we try to get this one to the finish line?

lazarusA avatar Apr 21 '25 20:04 lazarusA

Nothing split out yet. We had some discussions about moving this to MapTiles and factoring out a MapTilesInterface.jl from that, which I haven't got to yet but hopefully can get to at some point.

In that case most of the downloaders etc will also go to MapTiles and Tyler can depend on that once it's ready.

Also there was some form of large refactor after I opened this PR, I don't remember exactly what it was, but I do remember that it may have caused issues with this PR so I didn't merge then. Can take a look again though, maybe we should get this in for now. But eventually it will live in MapTiles.

asinghvi17 avatar Apr 21 '25 20:04 asinghvi17