Comments (10)
Related on the shapely side, I'm planning to implement some M and ZM support for upcoming shapely-2.1.
Are you sure GDAL/OGR needs to be built with GEOS 3.12? I thought M/ZM support for GDAL/OGR was stand-alone, but correct me if needed. On the Fiona-side, more work is needed to implement, e.g., OGR_G_AddPointM and other higher-dimension CAPI methods.
from fiona.
@sentientnebula thank you for the suggestion! Can you please link to the GEOS change log entry or issue that discusses the problem and fix so I can learn more about this?
I'm not opposed to making a 1.9.5.post1 release to do this. A few weeks ago I would have been blocked, as vcpkg (which we use for Windows) is still on GEOS 3.11.2: https://github.com/microsoft/vcpkg/commits/master/versions/g-/geos.json. Recently, I've figured out how to work around that, and can probably make a local override to use GEOS 3.12 if the GEOS build system hasn't changed.
from fiona.
From 3.12 announcement on GEOS Website :
GEOS has been updated to read and write “M” dimension. As with the “Z” coordinate support, not all operations can preserve the “M” dimension, but best efforts are made to retain it through calculations, input and output.
https://libgeos.org/posts/2023-06-27-geos-3-12-released/
Github commits:
https://github.com/libgeos/geos/pull/721/commits
from fiona.
@sentientnebula I've thought about this a bit more and I wonder if there may be some confusion about the features of the fiona and shapely packages. wkt.loads
is from shapely, not fiona. And fiona does not call any GEOS methods at all, only GDAL/OGR methods. See for example https://github.com/Toblerity/Fiona/blob/master/fiona/_geometry.pyx#L277.
from fiona.
@sgillies That is why I said I don't think there are any changes you need to make to Fiona to get it to work other than updating GEOS so that GDAL/OGR can call the fixed GEOS that no longer returns M's as Z's. It should make Shapely's wkt.loads just start working because GDAL/OGR functions should start returning correct linestrings to Fiona when GEOS returns the correct linestrings to GDAL/OGR.
@mwtoews As far as I know, there is no way to get GDAL/OGR to support M/ZM without being built with GEOS 3.12. I realize that work will need to be done to get Shapely to actually manipulate M values, but I wouldn't expect you to need to do anything to make wkt.loads work other than get the corrected strings back from GDAL/OGR when it gets the correct ones from GEOS. If that is not the case, for some reason, I can just call the GDAL/OGR WKT conversion fuctions directly.
from fiona.
@mwtoews Right, I'm pretty sure that Fiona's serialization does not involve GEOS. I'll make a note about Z and M support there.
from fiona.
The API docs specify which functions require GEOS (e.g. OGR_G_Simplify).
GDAL/OGR has had M support since 2.1, see rfc 61.
from fiona.
GDAL supported M since 2.1 indeed, but when exporting geometries to GEOS, it dropped the M component. OSGeo/gdal#8652 that will hopefully make it in GDAL 3.8.0 no longer does that with GEOS >= 3.12
from fiona.
see last comment by jorisvandenbossche :
He got Shapely's wkt.loads function to work properly just by updating GEOS to 3.12, which for most Windows users would come via an update to the GEOS package bundled with Fiona.
I'm not using Windows by choice. I use Linux on all my home machines, where this wouldn't be an issue, but building my own wheels for packages with C++ extensions on a Windows work machine with user rights very heavily locked down by our IT department is something I'd rather not attempt.
from fiona.
He got Shapely's wkt.loads function to work properly just by updating GEOS to 3.12, which for most Windows users would come via an update to the GEOS package bundled with Fiona.
@sentientnebula GeoPandas depends on both shapely and fiona, but shapely and fiona are independent packages. Fiona does not upgrade shapely, at least not by design or specification. I'm going to close this issue. Better support for M and Z needs work in fiona's _geometry module and GEOS 3.12 won't help.
from fiona.
Related Issues (20)
- 1.10 release HOT 7
- Drop support for Python 3.7 and 3.8 HOT 5
- Support for PMTile?
- Remove dependency on Numpy for VSI read buffer HOT 1
- Bring back Python 3.8 for 1.10
- A new OGRGeometryH based Geometry class
- 1.9.6 release HOT 1
- Rename master branch to main
- Add name keyword argument to fiona.open() and Collection constructor HOT 2
- Address high priority items on OpenSSF scorecard report
- 1.9.6: build fails with `-Wincompatible-pointer-types` HOT 4
- Change python opener VSI plugin prefix to /vsifiopener
- 1.9.6: pytest fails in 47 units HOT 3
- 1.10 Windows wheels?
- Fiona no longer recognizes pd.Timestamp (as datetime.datetime) since 1.10 a2 HOT 3
- Make features printable again HOT 2
- Error when importing fiona on an M1 Mac. HOT 7
- Pip package fiona-1.9.6.tar.gz has inconsistent version: filename has '1.9.6', but metadata has '0.0.0' HOT 3
- RFE: use `zoneinfo` instead of `pytz`
- Field Name encode error when writing to Mapinfo File
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 fiona.