Can't create polygon from unclosed set of points

18 views
Skip to first unread message

Yarin Kessler

unread,
Dec 20, 2016, 12:56:31 PM12/20/16
to RGeo-Users


Following along the RGeo tutorial, I came across a discrepancy in behavior - When I tried to create the polygon from an unclosed set of points, as in the tutorial example, it would return nil.


DIDN'T WORK:

line_string1 = factory.line_string([point1, point2, point3])
large_triangle
= factory.polygon(line_string1) => nil

DID WORK:

line_string1 = factory.line_string([point1, point2, point3, point1])
large_triangle
= factory.polygon(line_string1) => #<rgeo::geos::capipolygonimpl:0x3fe171c35b58 "polygon="" ((1.0="" 0.0,="" 1.0="" 4.0,="" -2.0="" 0.0,="" 1.0="" 0.0))"="">


However, this was only an issue on my Mac. When I tried the same thing on my production server, the original (unclosed) example worked...?

Reply all
Reply to author
Forward
0 new messages