-
Notifications
You must be signed in to change notification settings - Fork 5
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
Geometry creation tutorial #151
Conversation
From: Alex Gardner <[email protected]> Co-authored-by: Alex Gardner <[email protected]>
I tried to add an example where for plotting a polygon with a different CRS (EPSG:32611) on the same map as the tutorial by was unable to get it to work. I think this would be useful for showing how different |
This was my attempt, following on from the first mapping example:
|
I don't see a definition for dest here - but there are a few examples in the GeoMakie docs that should help |
|
Ok now I read it all this is awesome! Really is something we need. Thanks @asinghvi17 I should have written this a year ago |
hmm, the whole idea is to set the using CairoMakie, GeoMakie
import GeoFormatTypes as GFT
using Interpolations # for Streamplot on gridded data if necessary
f(x::Point2{T}) where T = Point2{T}(
10 * (2 * cos(2 * deg2rad(x[1]) + 3 * deg2rad(x[2] + 30)) ^ 2),
20 * cos(6 * deg2rad(x[1]))
)
pole_longitude=177.5
pole_latitude=37.5
fig, ax, plt = streamplot(
f, 311.9..391.1, -23.6..24.8;
arrow_size = 6,
source = "+proj=ob_tran +o_proj=latlon +o_lon_p=0 +o_lat_p=$(pole_latitude) +lon_0=$(180+pole_longitude) +to_meter=$(deg2rad(1) * 6378137.0)",
axis = (;
type = GeoAxis,
title = "Streamplot",
)
)
lp = lines!(ax, GeoMakie.coastlines(); source = GFT.EPSG(4326), linewidth = 0.5, color = :black, xautolimits = false, yautolimits = false)
translate!(lp, 0, 0, -1)
fig |
Got it, thanks! |
I guess that wasn't made clear in the GeoMakie docs. I'll add a doc page about GeoAxis, and I guess the "multiple CRS" example doesn't show it off very well :D |
Are there plans to have the source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it!! I think the CRS part could use a little more polishing but I am happy we have such thorough documentation!
@asinghvi17 is there a function for adding crs info to an existing geometry ... I was looking for something line |
I don't think we have anything like that yet. Probably better to just create a new geometry with the CRS, or |
Stupid codespace server crashed when I was about to submit my modification... off to meetings now. I will get you something in a few hours |
It would be nice to be able to rebuild any geom with crs without needing to use the right constructor. We could make |
Is it by design that GeoMakie unable to plot a |
I'm pretty sure that there was just no convert_arguments added for that on the Makie end. We could add that I guess, at least for single How would you treat a vector of lines? Would it be continuous (as a LineString) or discontinuous (as individual linesegments)? |
|
This is a question for @rafaqz |
Moving some additional thoughts from the PR back over to Slack |
I imagine given a vector of lines we should plot each one separately. |
I just pushed some |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this PR
We don't want to apply this config all through the docs, because there are times you want full printing.
One last thing - I was going through this and figured we needed some anchor points, so added headers. I will merge for now, but if the headers seem unreasonable we can always change them! Thanks a lot for the effort @alex-s-gardner (and @JuliaGeo/geometryops for the reviews :D ) |
This PR adds a geometry creation tutorial plus some other doc improvements that sprang from there.
cc @alex-s-gardner