Comments (6)
Thank you both for reporting this issue.
I think this is related to this change in geos:
This is quite unfortunate for us, seems like we'll have to do a conditional over geos version. I should have time to do that by next week. If anyone can do it beforehand that would be more than welcome!
from rgeo.
@januszm once #364 is merged I'll release a version with these changes.
from rgeo.
I second this, this happens with multipolygons as well in an unexpected way. The following was explored on Ruby 3.1.2p20, with RGeo at 3.0.0 on macOS 13.1.
We pass the following geometry to RGeo:
MULTIPOLYGON(((12.932783211827351 55.52388199800951,12.93245550269099 55.52385006659112,12.932511159135071 55.52366627893948,12.932034283234547 55.523792667409026,12.932249636217353 55.52408517418492,12.932380445341693 55.52409792424644,12.932708140512728 55.52412986477694,12.932783211827351 55.52388199800951)),((12.934160764140689 55.524585414273915,12.935069804474448 55.52439776732449,12.935081366292575 55.52435334973056,12.935114165594179 55.5243561507144,12.935140137641318 55.52425637035675,12.935184353995986 55.524086684745086,12.935187805705446 55.52407342495578,12.93487752118115 55.52383636385861,12.93485414710541 55.52383440570438,12.934617654824683 55.523814586663214,12.93462363716453 55.52379159287159,12.934373893839348 55.523767266014715,12.934262076501895 55.52419653040539,12.934160764140689 55.524585414273915)))
and depending on geos-version, we get the following back out again. On 3.11.1 - we receive the expected geometry back:
MULTIPOLYGON (((12.932783211827351 55.52388199800951, 12.93245550269099 55.52385006659112, 12.932511159135071 55.52366627893948, 12.932034283234547 55.523792667409026, 12.932249636217353 55.52408517418492, 12.932380445341693 55.52409792424644, 12.932708140512728 55.52412986477694, 12.932783211827351 55.52388199800951)), ((12.934160764140689 55.524585414273915, 12.935069804474448 55.52439776732449, 12.935081366292575 55.52435334973056, 12.935114165594179 55.5243561507144, 12.935140137641318 55.52425637035675, 12.935184353995986 55.524086684745086, 12.935187805705446 55.52407342495578, 12.93487752118115 55.52383636385861, 12.93485414710541 55.52383440570438, 12.934617654824683 55.523814586663214, 12.93462363716453 55.52379159287159, 12.934373893839348 55.523767266014715, 12.934262076501895 55.52419653040539, 12.934160764140689 55.524585414273915)))
but on 3.12.0 - it's suddenly converted into a geometry with Z, even though it's not specified and not provided:
MULTIPOLYGON Z (((12.932783211827351 55.52388199800951 0, 12.93245550269099 55.52385006659112 0, 12.932511159135071 55.52366627893948 0, 12.932034283234547 55.523792667409026 0, 12.932249636217353 55.52408517418492 0, 12.932380445341693 55.52409792424644 0, 12.932708140512728 55.52412986477694 0, 12.932783211827351 55.52388199800951 0)), ((12.934160764140689 55.524585414273915 0, 12.935069804474448 55.52439776732449 0, 12.935081366292575 55.52435334973056 0, 12.935114165594179 55.5243561507144 0, 12.935140137641318 55.52425637035675 0, 12.935184353995986 55.524086684745086 0, 12.935187805705446 55.52407342495578 0, 12.93487752118115 55.52383636385861 0, 12.93485414710541 55.52383440570438 0, 12.934617654824683 55.523814586663214 0, 12.93462363716453 55.52379159287159 0, 12.934373893839348 55.523767266014715 0, 12.934262076501895 55.52419653040539 0, 12.934160764140689 55.524585414273915 0)))
from rgeo.
Thanks a lot for the quick look on this - while I'm comfortable exploring this in Ruby, the C-parts are a bit beyond me. Will this warrant a patch-level release or should I run from HEAD until a minor release?
from rgeo.
Thank you a lot for your reactivity and for maintaining this gem!
from rgeo.
Same just happened to me when I upgraded older app to GEOS 3.12 and Ruby 3.2
> RGeo::Geographic.spherical_factory.point("2", "1")
=> #<RGeo::Geographic::SphericalPointImpl:0x7170 "POINT (2.0 1.0)">
> record.shape = RGeo::Geographic.spherical_factory.point("2", "1")
> record.save
> record.shape
=> #<RGeo::Geos::CAPIPointImpl:0x715c "POINT Z (2 1 0)">
> record.shape.to_s
=> "POINT Z (2 1 0)"
Would downgrading to GEOS 3.11 or 3.10 solve this issue too?
Or should I rather switch to Github main/master version of this gem until the changes from this PR #361 are released , possibly as rgeo 3.0.1 or 3.1.0 ?
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
- 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.