Comments (5)
Got it you're using the Ruby implementation. I think since Geos is now returning either NULL
a point or a polygon rather than a linestring as well like in older versions we can make this change to match. I can work on a fix in the next few days.
from rgeo.
What version of geos are you using? On 3.10 I'm seeing a polygon when I run this.
from rgeo.
I have not installed geos for this.
Correct me if i am wrong, but this method no where specifies explicit dependency on geos.
Also in the factory-compatibiltiy doc, LineString#envelope
shows compatibilty with cartesian
factory.
from rgeo.
@keithdoggett is there any update to this.
also can i help in fixing this.
from rgeo.
I've looked into it but haven't had time to write a PR. We need to change the envelope
method in RGeo::Cartesian::GeometryMethods
(
rgeo/lib/rgeo/cartesian/feature_methods.rb
Lines 16 to 18 in 52d4240
Per Geos it can either return a polygon or a point (https://github.com/libgeos/geos/blob/a8d2ed0aba46f88f9b8987526e68eea6565d16ae/capi/geos_c.h.in#L3881-L3887), so we should just add a check for the returned geometry from the BoundingBox
call and if it's a linestring, coalesce it into a polygon (probably by taking the points into an array).
i.e. something like this (haven't run this)
def envelope
env = BoundingBox.new(factory).add(self).to_geometry
if RGeo::Feature::LineString.check_type(env)
boundary = factory.line_string([env.start_point, env.end_point, env.start_point, env.end_point])
env = factory.polygon(boundary)
end
env
end
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
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.