Skip to content
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

Lower LinearRing min vertex limit to 3 #682

Merged
merged 1 commit into from
Feb 8, 2021

Conversation

dr-jts
Copy link
Contributor

@dr-jts dr-jts commented Feb 8, 2021

Lowers the constraint on the LinearRing minimum number of vertices to 3 (from 4). This allows invalid rings to be created, so that they can be found and fixed.

This provides a resolution to #558.

See also R-sf issue 1589.

Signed-off-by: Martin Davis mtnclimb@gmail.com

Signed-off-by: Martin Davis <mtnclimb@gmail.com>
@nicovanlooy
Copy link

Update corresponding exception message too in LinearRing.java:

if (getCoordinateSequence().size() >= 1 && getCoordinateSequence().size() < MINIMUM_VALID_SIZE) {  
    throw new IllegalArgumentException("Invalid number of points in LinearRing (found " 
       + getCoordinateSequence().size()
       + " - must be 0 or >= 4)");    
}

should be

if (getCoordinateSequence().size() >= 1 && getCoordinateSequence().size() < MINIMUM_VALID_SIZE) {  
    throw new IllegalArgumentException("Invalid number of points in LinearRing (found " 
       + getCoordinateSequence().size()
       + " - must be 0 or >= " + MINIMUM_VALID_SIZE + ")");    
}

@dr-jts
Copy link
Contributor Author

dr-jts commented May 17, 2021

Update corresponding exception message too in LinearRing.java

@nicovanlooy good point.

Fix is made in 8298604

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants