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

Polygon() crashed #29

Closed
zhangliye opened this issue Feb 11, 2017 · 8 comments
Closed

Polygon() crashed #29

zhangliye opened this issue Feb 11, 2017 · 8 comments
Labels

Comments

@zhangliye
Copy link

zhangliye commented Feb 11, 2017

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

@yeesian
Copy link
Member

yeesian commented Feb 11, 2017

Sounds reasonable. Will you like to try a PR for this?

@yeesian yeesian added the bug label Feb 11, 2017
@zhangliye
Copy link
Author

I am not sure how to handle PR. I will try.

@yeesian
Copy link
Member

yeesian commented Feb 11, 2017

Thanks!

@yeesian
Copy link
Member

yeesian commented Jun 4, 2017

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?

@visr
Copy link
Member

visr commented Jun 15, 2017

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])
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x0 -- unknown function (ip: 0000000000000000)
while loading no file, in expression starting on line 0
unknown function (ip: FFFFFFFFFFFFFFFF)
GEOSGeom_createLinearRing_r at C:\Users\visser_mn\.julia\v0.6\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\libgeos_c-1.DLL (unknown line)
Type at C:\Users\visser_mn\.julia\v0.6\LibGEOS\src\geos_types.jl:72

@yeesian
Copy link
Member

yeesian commented Jun 16, 2017

can you check and see if this happens with the latest binaries in #37?

@evetion
Copy link
Member

evetion commented Jun 17, 2017

Added testcase for this in #38.

@yeesian
Copy link
Member

yeesian commented Jun 17, 2017

closed by #38

@yeesian yeesian closed this as completed Jun 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants