Comments (5)
Confirmed, this is a bug. I'll get a fix out in RGeo 0.3.1 within the next day.
from rgeo.
Just to point out, I don't think my hack is the way it should be done, but just a way to get my specs to make it a bit farther before bailing :). Seeing as how there are a bunch of callers of Feature.cast()
, that should probably be the place to solve this. Come up with the appropriate semantics for passing Feature.cast()
a non-Feature
and then define equals?
, intersects?
, crosses?
, etc. in terms of that.
Or something. You obviously know the code a lot better than I do ;)
from rgeo.
I think the core issue here is that the ==
method is currently implemented as an alias of equals?
, whereas they shouldn't have exactly the same semantics. The latter is one of the OGC relational predicates and should expect to be passed a geometry. (Otherwise, it should probably raise an ArgumentError or a TypeError.) Feature.cast
similarly should expect to be passed a geometry and raise an appropriate exception accordingly. However, the former, ==
, has further semantics in Ruby dealing with object equality (and it looks like Rails' fixture code is expecting that), so passing other types should still work (and return false).
The fix I checked in last night makes this separation. The ==
operator checks the type before passing control to equals?
.
from rgeo.
I think the core issue here is that the == method is currently implemented as an alias of equals?, whereas they shouldn't have exactly the same semantics.
Makes sense. I don't have any familiarity with the OGC specs, so I don't have any opinion on that one way or the other.
The fix I checked in last night makes this separation.
Great! I'll look forward to a release with it included!
from rgeo.
RGeo 0.3.1 released with this fix.
from rgeo.
Related Issues (20)
- Set Precision for Coordinates HOT 4
- Create Documentation for Adding GEOS Functions to CAPI and FFI Implementations
- C Styleguide
- uby HOT 1
- CAPI stress test under low memory
- Polygon centroid has different SRID
- Concurrency problems with single app-wide factory? HOT 1
- rgeo 3 geom freeze behaviour HOT 3
- Expand classes in `CoordSys` module HOT 1
- Proj Rework: Clean up Core Gem
- Geos not supported HOT 3
- Tackle rubocop todo list HOT 4
- Geos not supported HOT 7
- `test_invalid_polygon_duplicate_rings` test is failing HOT 3
- Add Supported Geos Versions to CI
- `make_valid` throwing errors HOT 1
- RGeo::Error::InvalidGeometry: Unable to cast the geometry to the GEOS Factory HOT 3
- With geos 3.12, the CAPI factory enables Z geometries HOT 6
- RGeo::Geos.supported? false with GEOS 3.12 on Amazon Linux 2023 HOT 21
- `ENVELOPE` method on linestring does not return `POLYGON` HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rgeo.