Giter Club home page Giter Club logo

Comments (8)

pramsey avatar pramsey commented on August 25, 2024 1

So the result of MakeValid is the same for both the old/new overlay engines, which means the result isn't "wrong" per se, just that it's got a different way to turn an invalid input to a valid output.

screenshot_500

This is the output, the system has decided that the way to reconcile the doubled-up bottom rings is to use the outer ring as the enclosing ring, and return the spare inner ring as a line in a collection. The MakeValid code is very ring-centric, so this kind of falls out in an expected way.

A "better" or at least different MakeValid might drop all the edges into a graph and then decide what is an "enclosed area" by doing a scan-line routine. This is probably what we're seeing when we look at the rendering of the geometry in QGIS. Is it the "right" way to interpret the invalid geometry? Maybe, at least insofar as it's the visualization that most/many user interface tools will provide. I think waiting to add a graph-based MakeValid might be better than trying to coerce the existing routine into being something it is not.

from geos.

pramsey avatar pramsey commented on August 25, 2024 1

With the GeometryFixer ported at 5156001, this will be resolved on next release. (You'll have to use GEOSMakeValidWithParams if you're on the CAPI, or change from MakeValid to GeometryFixer if you're on C++ API)

from geos.

pramsey avatar pramsey commented on August 25, 2024

Is it an area or a line? Make valid can only do so much for you, if you feed it something nonsensical, it might return nonsense.

from geos.

jagill avatar jagill commented on August 25, 2024

The OGC has a spec for simplicity, and ISO has a spec for both validity and simplicity, for LineStrings. Moreover, if you have a large number of geometries, you should expect that you should be able to call makeValid on them without large surprises.

from geos.

Xuanzhen-Zhang avatar Xuanzhen-Zhang commented on August 25, 2024

Is it an area or a line? Make valid can only do so much for you, if you feed it something nonsensical, it might return nonsense.

It is a multipolygon border, so the area enclosed is quite small.

from geos.

pramsey avatar pramsey commented on August 25, 2024

OK, so it's a narrow corridor... and perhaps the invalidity is at the "pole", aka the bottom, where it does this.

screenshot_499

from geos.

jagill avatar jagill commented on August 25, 2024

This makes sense to me. It's not worth hacking the original routine with a special case. Is a graph-based MakeValid something that is on the backlog?

from geos.

pramsey avatar pramsey commented on August 25, 2024

Yes, a less hacked-together MakeValid is on the list of things, and will hopefully improve on the reliability of the current one a little. Unfortunately we might have these kind of behaviour changes, but I think as long as we return valid results, with some reliability that's all folks can reasonably ask.

from geos.

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.