Skip to content

Conversation

@asinghvi17
Copy link
Member

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).

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
Copy link
Member Author

asinghvi17 commented Jul 6, 2024

A current issue with this is how to handle the projection. I am treating everything as WGS84 right now because base Makie lacks support for attaching CRS. That is actually incorrect since the tiles are returned in web mercator coordinates, which means that stuff like this happens. Until we come to a conclusion on what to do here (reproject to WGS84 or just plot directly in webmerc), this PR will (a) not work right and (b) should not be merged.
download-1

Thoughts?  How do we determine which CRS the input bbox takes?

Its currently WGS84 but do we want to give an option to go to webmerc at all?  Conversion between the two is mostly lossless...
@asinghvi17
Copy link
Member Author

You can use this PR with GeoMakie as follows:

provider = TileProviders.Google() # suppose 
fig, ax, plt = image(
    provider, Rect2f((-180, -90), (360, 180)), 1000 #= size =#; 
    interpolate = false,
    source = "+proj=webmerc",
    axis = (; type = GeoAxis)
)
coastplt = lines!(ax, GeoMakie.coastlines(); color = :black, linewidth = .75)
fig

@asinghvi17
Copy link
Member Author

Closing in favour of #91

@asinghvi17 asinghvi17 closed this Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant