Comments (3)
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)))
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)))
Possibly this should be made an option to the function?
from geos.
@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.
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)))
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)
- CMake CMP0153 HOT 1
- CompoundCurve construction should ensure sections are continuous
- `GEOSBuffer` on a valid Polygon creates MultiPolygon with sliver geometry HOT 1
- Geometry produced by ST_SimplifyPreserveTopology is not stable across multiple runs HOT 28
- Edge of intersection not matching the edge of original polygon HOT 2
- Dynamic library is not fully setup by `make install` ( missing ldconfig ) HOT 3
- `include/geos/constants.h` - relies on transitive inclusion of `std::size_t` which breaks build in C++23 language mode
- Build fails in C++23 language mode due to one forward declaration HOT 3
- `voronoi_polygons` results in "IllegalArgumentException: point array must contain 0 or >1 elements" HOT 2
- could not find libgeos_c HOT 1
- Polygon buffer removes its hole when quadSegs = 0
- Doubts about the goes C interface HOT 1
- `simplify` with `preserve_topology=True` difference for MultiLineString between 3.12.1 and 3.12.2
- MSVC 32-bit test failure with LargestEmptyCircle HOT 1
- Is it possible to export to dxf format HOT 1
- Refactor MCIndexSegmentSetMutualIntersector to match JTS
- MakeValid method HOT 3
- How to split a polygon with a line? HOT 1
- OverlayNG should return Point for intersection between area and zero-length LineString
- Remove prebuilt capi_indexed_predicate binary
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geos.