locationtech / locationtech/jts

CoverageValidator does not detect gap if tolerance is too large

Open
#1,122 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

jts-core type-bug
Dominant language
Java
Stars
2.2k
Forks
475
Avg merge
14d 10h
Merged PRs (30d)
1

Description

The CoverageValidator may not detect narrow gaps if the gap tolerance is large relative to the input geometries. This is not ideal, since gaps may go undetected when using a tolerance that can detect large gaps.

Example

This is an extract from a dataset with much larger extent (so that a gap tolerance of say 1 seemed reasonable). The geometries contain a gap which is very narrow, between relatively short segments.

GEOMETRYCOLLECTION (
  POLYGON ((1.4021184536698854 1.655211920135038, 1.4021184539862759 1.6552119201560487, 1.4021299999999997 1.6559219999999968, 1.4021410000000003 1.6566259999999957, 1.4021410000000003 1.658296, 1.406 1.654, 1.4021184536698854 1.655211920135038)), 
  POLYGON ((1.406 1.654, 1.4 1.65, 1.4021410000000003 1.658296, 1.4021410000000003 1.6566259999999957, 1.4021365939839114 1.6563440149706494, 1.4021299996998664 1.6559220002002917, 1.4021184536698854 1.655211920135038, 1.406 1.654)))
Image

Using a gap tolerance of 0.00001 detects the gap, but larger tolerances do not.

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CoverageValidator and reproduce the issue using the supplied GEOMETRYCOLLECTION, first with a gap tolerance of 0.00001 and then with larger tolerances. Trace how the tolerance is applied when checking the narrow gap; done means the gap remains detectable without losing the ability to detect larger gaps.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.