Giter Club home page Giter Club logo

Comments (3)

dr-jts avatar dr-jts commented on August 25, 2024

This is working as expected (although I agree that the semantics might not be the most intuitive). In the LargestEmptyCircle algorithm the circle centre is constrained to lie inside the convex hull of the input, not the entire circle.

To constrain the entire circle to lie inside the convex hull, include the convex hull boundary as part of the constraints:

LEC of 3 triangles:

MULTIPOLYGON (((80 90, 140 130, 140 60, 80 90)), 
((240 150, 300 150, 290 210, 240 150)), 
((140 300, 214 284, 155 239, 140 300)))

image

LEC of 3 triangles plus convex hull boundary

GEOMETRYCOLLECTION (LINEARRING (140 60, 80 90, 140 300, 214 284, 290 210, 300 150, 140 60), 
POLYGON ((80 90, 140 130, 140 60, 80 90)), 
POLYGON ((240 150, 300 150, 290 210, 240 150)), 
POLYGON ((140 300, 214 284, 155 239, 140 300)))

image

Possibly this should be made an option to the function?

from geos.

nyalldawson avatar nyalldawson commented on August 25, 2024

@dr-jts ok, that makes sense. I think this is mostly a documentation issue -- the GEOSLargestEmptyCircle mixes up the terms of "obstacle" and "boundary", which makes it confusing to understand. I think the documentation may also be out of date as it explicitly states that "The obstacles are point and line geometries", yet it's working fine with polygon obstacles too...

from geos.

dr-jts avatar dr-jts commented on August 25, 2024

ok, that makes sense. I think this is mostly a documentation issue

Agreed, the docs are a bit confusing. They are just copying the JTS docs, which could do with some improvement.

-- the GEOSLargestEmptyCircle mixes up the terms of "obstacle" and "boundary", which makes it confusing to understand.

The boundary is different to the obstacles. Currently it defaults to the CH of the obstacles, but it could actually be any polygon.

I think the documentation may also be out of date as it explicitly states that "The obstacles are point and line geometries", yet it's working fine with polygon obstacles too...

Well, not really. Polygons are accepted as obstacles, but are treated as lines, not areas. E.g.:

MULTIPOLYGON (((90 140, 150 310, 335 92, 150 60, 90 140)), ((280 290, 270 220, 300 250, 280 290)))

image

It's fairly easy to fix this, and also to add an option to include the CH of the obstacles as a constraint so that the computed circle lies wholly inside it.

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.