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
ENVELOPE
method on linestring does not return POLYGON
#369
Comments
What version of geos are you using? On 3.10 I'm seeing a polygon when I run this. |
I have not installed geos for this. |
Got it you're using the Ruby implementation. I think since Geos is now returning either |
@keithdoggett is there any update to this. |
I've looked into it but haven't had time to write a PR. We need to change the 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 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 |
Steps to reproduce
Expected behavior
Should return POLYGON.
Actual behavior
Returning
LineImpl
when the 2 points are on a vertical or a horizontal lineSystem configuration
Ruby version:
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]
OS:
MacOS Ventura Version 13.3.1
The text was updated successfully, but these errors were encountered: