Coder Social home page Coder Social logo

Comments (12)

macdrevx avatar macdrevx commented on May 29, 2024

Might https://github.com/GEOSwift/GEOSwift/blob/main/Sources/GEOSwift/GEOS/Boundable.swift be what you're looking for?

from geoswift.

alessdiimperio avatar alessdiimperio commented on May 29, 2024

Aha ill chwck it out, perhaps misunderstoor the image as it shows just lines and not filled in polygon. If it works itll make my day

from geoswift.

alessdiimperio avatar alessdiimperio commented on May 29, 2024

Hmm im not sure i understand the usage of boundary.

What im trying to resolve is when users intersect lines in a polygon. instead of throwing an error, i want to ignore the internal intersection and create a polygon without the internal holes.

the concave hull algorithm is supposed to do just that. How can boundary be used for the same outcome?

Screenshot 2023-03-08 at 14 12 58

Screenshot 2023-03-08 at 14 14 39

Link to concave hull example
https://github.com/SanyM/ConcaveHull

now while there are packages like the above that support concave hull it would be nice to be able to solve the problem with less dependencies if possible.

from geoswift.

macdrevx avatar macdrevx commented on May 29, 2024

Apologies for my confusion. It looks like concave hull is new in geos 3.11. GEOSwift is currently on 3.10. We'll add concave hull after we update. (hopefully soon!)

from geoswift.

alessdiimperio avatar alessdiimperio commented on May 29, 2024

🤞 here's hoping :)
great work with the framework

from geoswift.

macdrevx avatar macdrevx commented on May 29, 2024

@alessdiimperio @vladislavitsi concave hull is now available on the main branch. Please give it a try and let me know if it looks okay!

from geoswift.

alessdiimperio avatar alessdiimperio commented on May 29, 2024

any example of how the implementation works?

to get these changes should i add => mainbranch url in pods?

from geoswift.

macdrevx avatar macdrevx commented on May 29, 2024

I released the changes in v10: https://github.com/GEOSwift/GEOSwift/releases/tag/10.0.0

I don't have any examples, but the release notes at that link show the method name. You just invoke it on any geometry.

from geoswift.

alessdiimperio avatar alessdiimperio commented on May 29, 2024

Tested it finally, and while it works, it unfortunately doesn't give the desired effect in many cases even.
Is there some other way to ignore "holes" in LinearRings ? or ignore the internal coordinates when a linearRing intersects itself?
With the images i provided as some sort of example.

from geoswift.

macdrevx avatar macdrevx commented on May 29, 2024

@dr-jts could you please advise here?

from geoswift.

dr-jts avatar dr-jts commented on May 29, 2024

Perhaps the GEOSMakeValid function could help here? Note that this probably needs the GEOS_MAKE_VALID_STRUCTURE method (use GEOSMakeValidWithParams to specify this).

For a full explanation see https://lin-ear-th-inking.blogspot.com/2021/05/fixing-invalid-geometry-with-jts.html

from geoswift.

macdrevx avatar macdrevx commented on May 29, 2024

Thank you! @alessdiimperio, we expose only GEOSMakeValid (makeValid() on any GeometryConvertible) right now, but we'd be happy to expose GEOSMakeValidWithParams as well. Would you mind opening a new issue to track that?

from geoswift.

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.