Skip to content
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

add z_index function #24

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

add z_index function #24

wants to merge 3 commits into from

Conversation

rafaqz
Copy link
Member

@rafaqz rafaqz commented Jan 22, 2023

Adds a function to get the z index for a specific extent and resolution.

Needs tests

src/tiles.jl Outdated Show resolved Hide resolved
Comment on lines +118 to +119
We assume tiles are the standard 256*256 pixels. Note that this is not an
enforced standard, and that retina tiles are 512*512.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it's best to directly add the tile size as an argument?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I considered that too. I guess a keyword with default is best.

Co-authored-by: Martijn Visser <[email protected]>
@visr visr marked this pull request as draft January 30, 2023 10:37
We assume tiles are the standard 256*256 pixels. Note that this is not an
enforced standard, and that retina tiles are 512*512.
"""
function z_index(extent::Extent, res::NamedTuple, crs::WebMercator)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also accept tuples (x, y) as Makie does? In that case we can also make z_index(..., Tuple) = z_index(..., (; X = ..., Y = ...)) or so.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should probably also be a catchall method to error when crs is not WebMercator (for now...)

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.

3 participants