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

Eep! poly is deleting points from the source vector of Points #417

Closed
NHDaly opened this issue Dec 28, 2019 · 4 comments
Closed

Eep! poly is deleting points from the source vector of Points #417

NHDaly opened this issue Dec 28, 2019 · 4 comments

Comments

@NHDaly
Copy link

NHDaly commented Dec 28, 2019

Eeep! Makie is eating points out of my polygon!

Screen Shot 2019-12-28 at 2 05 47 PM

julia> polygon = copy(scaled_regions[end-3])
3-element Array{GeometryTypes.Point{2,Float32},1}:
 [-162.14532, 23.070765]
 [-161.69984, 23.03172] 
 [-162.14038, 23.10463] 

julia> Makie.poly(polygon)
ERROR: Not enough points in the contour. Found: GeometryTypes.Point{2,Float32}[[-162.14532, 23.070765], [-161.69984, 23.03172]]
Stacktrace:
 [1] polygon2faces(::Array{GeometryTypes.Point{2,Float32},1}, ::Type) at /Users/nathan.daly/.julia/packages/GeometryTypes/SnZ4l/src/polygons.jl:84
 [2] GLNormalMesh(::Array{GeometryTypes.Point{2,Float32},1}) at /Users/nathan.daly/.julia/packages/GeometryTypes/SnZ4l/src/polygons.jl:143
 [3] _broadcast_getindex_evalf at ./broadcast.jl:630 [inlined]
 [4] _broadcast_getindex at ./broadcast.jl:603 [inlined]
 [5] getindex at ./broadcast.jl:563 [inlined]
 [6] copy at ./broadcast.jl:853 [inlined]
 [7] materialize at ./broadcast.jl:819 [inlined]
 [8] (::AbstractPlotting.var"#303#305")(::Array{Array{GeometryTypes.Point{2,Float32},1},1}) at /Users/nathan.daly/.julia/packages/AbstractPlotting/B5nOF/src/basic_recipes/basic_recipes.jl:63
 [9] lift(::Function, ::Observables.Observable{Array{Array{GeometryTypes.Point{2,Float32},1},1}}) at /Users/nathan.daly/.julia/packages/AbstractPlotting/B5nOF/src/interaction/nodes.jl:9
 [10] plot!(::Poly{...}) at /Users/nathan.daly/.julia/packages/AbstractPlotting/B5nOF/src/basic_recipes/basic_recipes.jl:57
 [11] plot!(::AbstractPlotting.Scene, ::Type{Poly{...}}, ::AbstractPlotting.Attributes, ::Tuple{Observables.Observable{Array{GeometryTypes.Point{2,Float32},1}}}, ::Observables.Observable{Tuple{Array{Array{GeometryTypes.Point{2,Float32},1},1}}}) at /Users/nathan.daly/.julia/packages/AbstractPlotting/B5nOF/src/interfaces.jl:638
 [12] #plot!#208(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(AbstractPlotting.plot!), ::AbstractPlotting.Scene, ::Type{Poly{...}}, ::AbstractPlotting.Attributes, ::Array{GeometryTypes.Point{2,Float32},1}) at /Users/nathan.daly/.julia/packages/AbstractPlotting/B5nOF/src/interfaces.jl:560
 [13] plot!(::AbstractPlotting.Scene, ::Type{Poly{...}}, ::AbstractPlotting.Attributes, ::Array{GeometryTypes.Point{2,Float32},1}) at /Users/nathan.daly/.julia/packages/AbstractPlotting/B5nOF/src/interfaces.jl:529
 [14] #poly#295(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(AbstractPlotting.poly), ::Array{GeometryTypes.Point{2,Float32},1}) at /Users/nathan.daly/.julia/packages/AbstractPlotting/B5nOF/src/recipes.jl:15
 [15] poly(::Array{GeometryTypes.Point{2,Float32},1}) at /Users/nathan.daly/.julia/packages/AbstractPlotting/B5nOF/src/recipes.jl:13
 [16] top-level scope at none:0

julia> polygon
2-element Array{GeometryTypes.Point{2,Float32},1}:
 [-162.14532, 23.070765]
 [-161.69984, 23.03172] 
@asinghvi17
Copy link
Member

asinghvi17 commented Dec 29, 2019

I ran into this issue as well, when dealing with lat/long data. If you're doing that, try to project it onto a different domain? The array drop shouldn't happen, though.

This occurs, btw, because

julia> 162.14038f0  162.14532f0
true

SimonDanisch added a commit to JuliaGeometry/GeometryTypes.jl that referenced this issue Dec 30, 2019
SimonDanisch added a commit to JuliaGeometry/GeometryTypes.jl that referenced this issue Dec 30, 2019
@SimonDanisch
Copy link
Member

This release of GeometryTypes should fix it: JuliaRegistries/General#7336

@NHDaly
Copy link
Author

NHDaly commented Dec 30, 2019

Awesome, so quick! :D Thanks!

@NHDaly
Copy link
Author

NHDaly commented Dec 30, 2019

(also, thanks for releasing when you fix bugs. Wish everyone did that! 😄❤️!)

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

No branches or pull requests

3 participants