Code Monkey home page Code Monkey logo

Comments (10)

mwtoews avatar mwtoews commented on June 14, 2024 1

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.

sgillies avatar sgillies commented on June 14, 2024

@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.

sentientnebula avatar sentientnebula commented on June 14, 2024

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.

sgillies avatar sgillies commented on June 14, 2024

@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.

sentientnebula avatar sentientnebula commented on June 14, 2024

@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.

sgillies avatar sgillies commented on June 14, 2024

@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.

mwtoews avatar mwtoews commented on June 14, 2024

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.

rouault avatar rouault commented on June 14, 2024

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.

sentientnebula avatar sentientnebula commented on June 14, 2024

see last comment by jorisvandenbossche :

shapely/shapely#882

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.

sgillies avatar sgillies commented on June 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.