-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable ring-endpoint-handling for LineString with isRing() == true #1033
Conversation
* Remove redundant casts * Remove unnecessary local variable
Note: visibility of constructor is better than that of its arguments
It's not clear from the description what this PR does? Are you suggesting changing the |
public void testLinearRingRemoveEndpoint() throws Exception { | ||
checkTPS( | ||
"LINEARRING (220 180, 261 175, 380 220, 300 40, 140 30, 30 220, 176 176, 220 180)", | ||
40, | ||
"LINEARRING (30 220, 380 220, 300 40, 140 30, 30 220)" | ||
); | ||
checkTPS( | ||
"LINESTRING (220 180, 261 175, 380 220, 300 40, 140 30, 30 220, 176 176, 220 180)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is intended to test behaviour on LINEARRING
geometries. A LINESTRING
geometry should be in a separate test.
There should be a test for closed LineStrings, even if this behaviour PR is not accepted. I will add that once this has be closed.
Yes.
Take a look at the following snipplet:
If this is true, then any operation on either of these geometries should give the same result. |
Not necessarily. The OGC topological model is somewhat limited in terms of real-world requirements, IMHO. That's why the concept of For an example, consider simplifying a road network that contains "loops" - e.g. turn-arounds modelled as closed LineStrings. In order to preserve network integrity, the endpoints of all lines must be preserved, including those of closed LineStrings. What could be done is allow the simplify behaviour to be controlled by an option flag. This takes effort and complicates the API, so is there a clear practical use case for this? |
You have a point regarding |
With the current state of
TopologyPreservingSimplifier
and related classes, theLINEARRING (220 180, 261 175, 380 220, 300 40, 140 30, 30 220, 176 176, 220 180)
simplifies toLINEARRING (30 220, 380 220, 300 40, 140 30, 30 220)
using a tolerance value of40
. (see here)Performing the same operation on
LINESTRING (220 180, 261 175, 380 220, 300 40, 140 30, 30 220, 176 176, 220 180)
givesLINESTRING (220 180, 380 220, 300 40, 140 30, 30 220, 220 180)
.