nofxx / georuby

This is intended as a holder for geometric data. The data model roughly follows the OGC.
MIT License
245 stars 55 forks source link

On Ruby 2.1.0 the HexEWKBParser fails to give correct results #26

Closed cr0ne closed 10 years ago

cr0ne commented 10 years ago

h = "01010000207B000000CDCCCCCCCCCC28406666666666A64640"

f2 = GeometryFactory::new ep = EWKBParser::new(f2) e = [h].pack("H*") ep.parse(e) f2.geometry.x => 12.4

f1 = GeometryFactory::new hp = HexEWKBParser::new(f1) hp.parse(h) f1.geometry.x => -3.495080594483092e-247

stkfd commented 10 years ago

Just ran into this bug as well, any news on this? Is there hope for a fix some time or is this gem not being actively maintained any more?

nofxx commented 10 years ago

Weird, it's all good here with Ruby v2.1.2. Also specs green. Any other spec I could add? Closing until.

stkfd commented 10 years ago

Actually, in my case it turned out to be unrelated to to this gem. Should have shared my discovery here back then. It's been a while so I don't remember all the details, but there is a GeoRuby gem and a georuby gem (this one), and while I was using this gem, one of the other gems that I was using had the capitalized one in its dependencies which lead to endless confusion. That capitalized GeoRuby gem seems to refer to an older version of this one and I'm pretty sure it caused the error. So this can definitely stay closed, just thought I'd share the origin of the bug in case someone with the same problem stumbles upon this. I ended up forking the gem with the faulty dependency and changed it.