Comments (10)
Will take a look! I suspect this is a result of CairoMakie drawing the polygons incorrectly when they are outside the bounds of the projection.
Do you get the same issue with GLMakie?
from makie.jl.
This is a CairoMakie issue, so I'll see about transferring the issue to the Makie repo.
My first thought is that this is caused by the clamp
in CairoMakie's project method - it should instead set coordinates to NaN.
from makie.jl.
I want to refactor the way all transforms work at some stage, so this would definitely be a target for that refactor!
The primary issue is that there's no completely reliable way to get the bounding polygon for an arbitrary projection (as far as I understand it, at least) without defining it yourself (as, for example, Cartopy has done).
from makie.jl.
Plotting lines on top is not a problem, neither is the problem resolved with a different perspective
from makie.jl.
Haven't checked will report back
from makie.jl.
Not a problem with GLMakie
So should this issue go over to Makie/CairoMakie? Or is that something that needs fixing here?
from makie.jl.
Here's a more minimal MWE:
fig = Figure()
ga = GeoAxis(fig[1, 1]; dest = "+proj=ortho +lon_0=0 +lat_0=30")
lines!(ga, GeoMakie.coastlines())
poly_in_bounds = GI.Polygon([GI.LinearRing(Point2f[(72, 19), (100, 19), (100, 39), (72, 39), (72, 19)])])
poly_out_bounds = GI.Polygon([GI.LinearRing(Point2f[(72, 19), (120, 19), (100, 39), (72, 39), (72, 19)])])
poly!(ga, poly_in_bounds; color = (:red, 0.5))
poly!(ga, poly_out_bounds; color = (:yellow, 0.5))
fig
from makie.jl.
Even more minimal:
fig = Figure()
ax, p1 = poly(fig[1, 1], GI.Polygon([GI.LinearRing(Point2f[(72, 19), (100, 19), (100, 39), (72, 39), (72, 19)])]))
p2 = poly!(ax, GI.Polygon([GI.LinearRing(Point2f[(72, 19), (Inf, 19), (100, 39), (72, 39), (72, 19)])]))
fig
from makie.jl.
With a patch to not draw any polygon segment which is not finite, I get:
This is suboptimal, since some areas which should be shaded are not shaded, but better this than nothing I think.
From the GeoMakie perspective, the only way to do this is correctly is by intersecting the boundary line of the polygon with the boundary line of the visible Earth. Cartopy does this by manually defining the boundary of the projection, and I suspect that at some point we will have to do the same.
From a Makie perspective, this is also not great. Note that, ideally, this should have drawn the yellow box leading towards infinity to the bottom right, but here is drawing to the top left of the screen (not the plot) since the infinity is apparently getting translated to 0.
From my testing, GLMakie either segfaults or refuses to draw such invalid polygons, so perhaps CairoMakie not drawing this polygon is more in line with expected behaviour.
from makie.jl.
I don't know how this works under the hood but could you clamp vertices of polygons that are partially outside? In the end an orthographic projections always maps onto a disc so a check like x^2 + y^2 > radius could be the basis of this?
from makie.jl.
Related Issues (20)
- `hist(dates)` MethodError
- Units in axis labels HOT 2
- Disable Automatic Unit Conversion
- Units in colorbar
- contour[f] doesn't work with units
- image doesn't work with units HOT 1
- ecdfplot does not honor attributes
- Poor performance when drawing 900 lines in 3d HOT 7
- 3D Camera glitches with WGLMakie, not with GLMakie HOT 4
- Wrap tutorial doesn't work anymore HOT 10
- Formatting.jl is causing warnings when installing HOT 3
- Regression - `hist(data; alpha = 0.5)` stopped working
- Unable to pass attributes if re-directed by recipe HOT 2
- Clean install of CairoMakie#master will does not compile on Ubuntu 22.04.4 LTS HOT 2
- Lines plot artifacts with GLMakie v0.10.2 on julia 1.10.3 (win10) HOT 7
- Cutting planes (volumetric visualization) HOT 1
- Allow different line widths in contour HOT 2
- Invalid attribute strokewidth for plot type Wireframe, Makie v0.21.2
- GLMakie: `offset_bezierpath` ends in infinite recursive loop as a result of calling `scatter!`
- glDeleteTextures segfault
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from makie.jl.