I have been following Daniel Azuma's excellent tutorial at
http://blog.daniel-azuma.com/archives/88. I am on part 3. I am certain Geos and proj is working. I follow the tutorial exactly, when I try to convert line_string1 into a polygon it returns nil. I have also tried several of my own variations (including polygons from linestrings with more than 3 points and I tried passing an array of points). I can get the intersects to work from the example before the polygon, although I had to add a ? otherwise it wasn't recognizing the method. Has something changed with polygon since this tutorial was written, or am I missing something?
Code:
1.9.3-p385 :069 > line_string1
=> #<RGeo::Geos::CAPILineStringImpl:0x1740260 "LINESTRING (1.0 0.0, 1.0 4.0, -2.0 0.0)">
1.9.3-p385 :070 > large_triangle = factory.polygon(line_string1)
=> nil
1.9.3-p385 :071 > large_triangle
=> nil
1.9.3-p385 :072 >
As you can see Ruby version 1.9.3-p385. RGeo Version says "0.3.20". Rails version "3.2.12". RGeo::Geos.version = "3.3.3".
Any help would be appreciated.
Thanks,
Spencer Renosis