Giter VIP home page Giter VIP logo

Comments (6)

jblindsay avatar jblindsay commented on May 16, 2024

WhiteboxTools has its own custom implementation of a Shapefile encoder/decoder and it follows the published 1998 Shapefile Whitepaper very closely. The various supported Shape Types of a Shapefile are provided on page 4 of the linked document. There is no LineString Shape Type. I suspect that it would be the same, in terms of how it is being stored, as a PolyLine. The problem is, there is no numerical value provided for the LineString alias. It would seem that either shapely or geopandas are implementing their own modified version of a Shapefile. I'm not sure what to do about that. However, I would suggest that if you are able to convert it to a proper PolyLine, that is likely the easiest solution.

from whitebox-tools.

jblindsay avatar jblindsay commented on May 16, 2024

@lahm3d Is it possible that you can forward me your stream shapefile so that I can take a look at its internal structure? Most importantly, I need to know what numeric value they are placing in the ShapeType part of the file to indicate the LineString type.

from whitebox-tools.

lahm3d avatar lahm3d commented on May 16, 2024

Thanks @jblindsay. Of course, here is the stream shapfile.

I tried, unsuccessfully, to modify the the stream shapefile's schema using fiona, but that threw the following error:

fiona.errors.UnSupportedGeometryTypeError: 'PolyLine'

I will also try explicitly specifying my output schema and geometry type and see if that fixes the geometry issue. Thanks again!

from whitebox-tools.

jblindsay avatar jblindsay commented on May 16, 2024

Thank you for sending me your file. This was very helpful for diagnosing the issue. I've come to realize that LineString25D (the ShapeType that QGIS provides for your file) is just an alias for PolyLineZ. The actual problem with reading the file was on my part. It turns out that for a PolyLineZ, although there are Z and M parts to each geometry, the M parts are optional. Your file does not use the optional M parts. Admittedly, I've never seen a file do this before; however, the Shapefile Whitepaper makes it clear that this is a valid form of the file format. As such, I've added the ability to leave out the M component of PolyLineZ, PolygonZ, and MultiPointZ Shapefile Geometries and have submitted a fix to the repo. The fix will be available in the next release of the software, which I am hoping to release sometime in the next week. If you cannot wait for this, you may consider compiling from source. I'm closing the issue now but please feel free to re-open if you encounter further problems with this issue. Thank you again for not only reporting the issue but for also providing enough information to diagnose the problem. Much appreciated!

from whitebox-tools.

lahm3d avatar lahm3d commented on May 16, 2024

Belated thanks @jblindsay. I was able to compile and successfully test the clip function. And thank you very much for your continued help and support!

from whitebox-tools.

jblindsay avatar jblindsay commented on May 16, 2024

@lahm3d Glad to hear that it worked for you and thanks again for reporting the issue.

from whitebox-tools.

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.