Comments (6)
The minimum number of points in a LinearRing can definitely be reduced to 3, instead of 4. That will handle the data in both issues above. I haven't seen any data which requires a lower limit, so probably best to make the minimal change for now.
from geos.
from geos.
I wonder what MakeValid should do. To remove the flat ring that does not have any area, or to maintain the topology by creating a minimal buffer or by adding a fourth point with a small offset?
from geos.
I wonder what MakeValid should do. To remove the flat ring that does not have any area, or to maintain the topology by creating a minimal buffer or by adding a fourth point with a small offset?
That's a very timely question, since I'm working on a GeometryFixer
class for JTS (for eventual port into GEOS, since it has slightly different semantics to MakeValid
. I'm not sure there's an obvious right answer. I do NOT think that the flat ring should be buffered or have points added, however, for reasons of performance and (more importantly) avoidance of introducing unexpected coordinates.
So the options for fixing a ring with too few points seem to be:
- turn it into a
LineString
or aPoint
- turn it into a
LINEARING EMPTY
There is the same issue for a ring with many points but which is flat, and a LineString with too few points.
Another approach I am considering is that if the ring (or line) is an atomic geometry, then reduce it to a geometry of inherent dimensional type; OR if if the ring/line is part of a collection, then drop it. This avoids creating collections of mixed type, which are awkward to handle.
Feedback welcome.
from geos.
When I think where I have met such geometries, OpenStreetMap data has always had them for some reason, and at least some MVT vector tile writers degenerate rings into straight lines occasionally. As a user of the data I would probably appreciate to have an option to get placeholders for locating those places because originally they may have been meaningful. POINT
would do for that purpose. LINEARRING EMPTY
is theoretically fine but otherwise useless, I think.
Maybe in most cases I would like to get rid of the flat rings and others like in your latter approach. In typical GIS data degenerated things feel like something that is left from bad simplification. If data provider really wanted to use topology preserving simplification it is still impossible to fix the data afterwards because probably there are also successfully removed rings. The OpenStreetmap case is different because the contributor maybe digitized and tagged the data just that way and they just did not know how to do it right.
My main vector tool is OpenJUMP so I do not fear collections, but for most GIS users they are complicated.
from geos.
@jratike80 Sounds like there needs to be some options for users to use when making valid geometries. At least one to indicate whether to drop collapsed elements, or to preserve them as lower-dimension elements.
from geos.
Related Issues (20)
- Relate predicates fail on almost-identical polygons with small coordinate discrepancies
- Stack Overflow in coordinate.h HOT 1
- Segmentation fault in polygon.cpp
- Segmentation fault in CGAlgorithmsDD.cpp
- Segmentation fault in Centroid.cpp
- heap-buffer overflow in LineIntersector.h HOT 1
- GEOSLineSubstring segfault with fraction = NaN HOT 3
- Stack overflow in LineSegment.h
- Segmentation Fault in FacetSequence.cpp
- heap-buffer overflow in geos_ts_c.cpp HOT 1
- heap-buffer overflow at line 2631 in geos_ts_c.cpp HOT 1
- stack-buffer-overflow related to non-DE9IM argument for GEOSRelatePatternMatch_r
- Encountered some issues when using 'voronoi_polygons' HOT 1
- What's the format of MULTIPOINT ? HOT 2
- GEOS policy for Z ordinate value population? HOT 17
- CoordinateSequence constructors change dimension to 3, fail to set hasZ HOT 2
- Versioning confusion
- [Documentation][CAPI] Missing comment lines for `tree` parameter` in `GEOSSTRtree_(build|destroy)` methods
- Standardize capi unit tests to always use the non-reentrant API HOT 1
- Add function to split geometries HOT 2
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.