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

turn GeoAxis into a block and fix projection #148

Closed
wants to merge 13 commits into from

Conversation

SimonDanisch
Copy link
Member

@SimonDanisch SimonDanisch commented Feb 1, 2023

Needs: MakieOrg/Makie.jl#2645

This changes the axis to use a manual Makie.@Block macro, to re-create something similar to Makie.Axis, without creating a whole Makie.Axis.

Enables:

  • chose axis=(; type=GeoAxis) and pass all other axis attributes like that:

    • lines(GeoMakie.coastlines(); axis=(; type=GeoAxis))
  • Plots now can pass source=source_data_projection , to allow for different input source projections

    • lines!(axis, ..., source="+proj=longlat +datum=WGS84")
    • GeoAxis still has a default source_projection = "+proj=longlat +datum=WGS84" and target_projection = "+proj=eqearth"
    • we can overload create_transform(dest::String, source::String) for other projection types then Proj + strings
  • intercepts poly call to create triangulation after projection, removing incorrect triangulations form distorting projections

  • the GeoAxis now doesn't have it's own transform_func, and just works on "normal" 2d data, getting rid of all the limit problems (instead, the plot data gets it's own transformation and get transformed before plotting)

    • with this zooming + panning etc works much better

TODOs

  • add better gridlines + ticks
  • tests
  • apply @gaelforget split method in apply_transform ... But I think we'll need to make the split function projection aware for that first?
  • add attributes like title

Stretch goal

  • refactor Makie Axis code to be better re-usable (I had to copy quite a few methods out of Makie/makielayout/blocks/axis.jl, since it was just almost working, but had a few tiny things that were different, or simply methods that were restricted to ::Axis

@asinghvi17 asinghvi17 self-assigned this Feb 1, 2023
@asinghvi17 asinghvi17 added the enhancement New feature or request label Feb 1, 2023
@asinghvi17 asinghvi17 linked an issue Feb 1, 2023 that may be closed by this pull request
@asinghvi17
Copy link
Member

asinghvi17 commented Feb 1, 2023

Current TODO list is:

  • Add title and subtitle capabilities
  • Add protrusions back in
  • Add automatic limit finding for projections (aka the dumb and brute force way) back in
  • Figure out a solution to show axes where the limits in long, lat space are not a rectangle, i.e., orthographic plots with the pole at an angle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Template for GeoAxis
2 participants