-
Notifications
You must be signed in to change notification settings - Fork 24
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
Polygon() crashed #29
Comments
Sounds reasonable. Will you like to try a PR for this? |
I am not sure how to handle PR. I will try. |
Thanks! |
Hey Liye, I haven't been able to reproduce this issue: julia> using LibGEOS
julia> pts = [[0.,0.],[10.,0.], [10.,10.],[0.,10.] ]
4-element Array{Array{Float64,1},1}:
[0.0,0.0]
[10.0,0.0]
[10.0,10.0]
[0.0,10.0]
julia> Polygon([pts]) # crashed here
ERROR: LibGEOS: Error in GEOSGeom_createPolygon
in createPolygon(::Ptr{Ptr{Void}}, ::Array{Ptr{Ptr{Void}},1}) at /Users/yeesian/.julia/v0.5/LibGEOS/src/geos_functions.jl:371
in LibGEOS.Polygon(::Array{Array{Array{Float64,1},1},1}) at /Users/yeesian/.julia/v0.5/LibGEOS/src/geos_types.jl:74
julia> pts = [[0.,0.],[10.,0.], [10.,10.],[0.,10.],[0.,0.]]
5-element Array{Array{Float64,1},1}:
[0.0,0.0]
[10.0,0.0]
[10.0,10.0]
[0.0,10.0]
[0.0,0.0]
julia> Polygon([pts]) # correct
LibGEOS.Polygon(Ptr{Ptr{Void}} @0x00007fbbdc559dd8) Admittedly, we can make the error message more informative, and suggest that it could be due to the rings not being closed. But we do throw an error, rather than crashing julia. Is it still an issue for you? |
On windows this is still an issue, may be related to #35 julia> using LibGEOS
julia> pts = [[0.,0.],[10.,0.], [10.,10.],[0.,10.] ];
julia> Polygon([pts])
|
can you check and see if this happens with the latest binaries in #37? |
Added testcase for this in #38. |
closed by #38 |
pts = [[0.,0.],[10.,0.], [10.,10.],[0.,10.] ]
Polygon([pts]) # crashed here
pts = [[0.,0.],[10.,0.], [10.,10.],[0.,10.] ]
Polygon([pts]) # correct
suggestion:
(1) Polygon() should check the input and add the end point if last input point is not same as the first point.
(2) throw an error rather than crash.
running on Win7, Julia 5.0, LibGEOS v0.1.0
The text was updated successfully, but these errors were encountered: