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
Inconsistent behavior between Ruby and C implementations #173
Comments
@teeparham do you think this is at all related to the fact that My thought process is that the features are expanded by the I pulled the thread as much as I could and that seems to be the biggest hole based on my understanding of the C APIs. Either way I plan on trying my fix and reporting back later today. |
is there a way to specify to not use the c api under any circumstances, the ruby api works fine for development, but then the c api is broken in production. |
The issue is that the C API will return either a For example: c_factory = RGeo::Geos.factory
poly = c_factory.parse_wkt("POLYGON ((-120.0 60.0, 120.0 60.0, 120.0 -60.0, -120.0 -60.0, -120.0 60.0), (-60.0 30.0, 60.0 30.0, 60.0 -30.0, -60.0 -30.0, -60.0 30.0))")
poly.boundary
=> #<RGeo::Geos::CAPIMultiLineStringImpl "MULTILINESTRING ((-120.0 60.0, 120.0 60.0, 120.0 -60.0, -120.0 -60.0, -120.0 60.0), (-60.0 30.0, 60.0 30.0, 60.0 -30.0, -60.0 -30.0, -60.0 30.0))"> Per the OGC SFS boundaries for Polygons should work as follows:
So it seems like the |
A friend and I were using the gem and noticed a difference in behavior between our two machines: mine was using the C implementations whereas his was sticking with Ruby. This by itself is not an issue.
However, we found out that the two implementations have different behaviors when calling the
#boundary
method on aPOLYGON
object. The Ruby implementation returns aMULTILINESTRING
whereas the C implementation returns a simpleLINESTRING
. This caused an exception because the former responds to the#first
method and the latter does not.Code to reproduce the issue
The output:
The text was updated successfully, but these errors were encountered: