question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ContourBuilderForTin doesn't like coordinates of zero

See original GitHub issue

When a ContourBuilderForTin is initialised with a vertices list where some vertices have 0 in either the x or y coordinate, the following error is returned. Fudging the coordinates by 0.0001 fixes the problem.

java.lang.NullPointerException: Cannot invoke "org.tinfour.contour.PerimeterLink.addContourTip(org.tinfour.contour.Contour, boolean)" because "pStart" is null
	at org.tinfour.contour.ContourBuilderForTin.buildRegionsUsingPerimeter(ContourBuilderForTin.java:701)
	at org.tinfour.contour.ContourBuilderForTin.buildRegions(ContourBuilderForTin.java:638)
	at org.tinfour.contour.ContourBuilderForTin.<init>(ContourBuilderForTin.java:253)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
gwlucastrigcommented, Apr 21, 2021

I basically have this fix completed and have posted an updated version of the code in the repository. I am still doing some final clean up, adding some more comments and Javadoc, etc. I will be submitting the final version soon.

The issue was related to the many special cases that can occur when contours are allowed to pass through vertices… That is, when there exist vertices with the exact z values as a contour. I did quite a bit of rework on the code to address these situations. I’ve also added an inspection utility that performs several tests to verify that a result is correct.

The attached an image was created by contouring elevation data from a Lidar sample taken over Bear Mountain in Salisbury Connecticut. The image represents a 1 kilometer square area. Contours are drawn at 5 meter intervals ranging from 540 meters to 705 meters above mean sea level. ContourLas05

1reaction
gwlucastrigcommented, Mar 24, 2021

I just posted improvements to contouring to address this issue. However, I’ve discovered some new special-cases that cause the contouring to fail. So I am leaving this issue open and continuing work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

提问,如何在window上开发,通过designer设计ui,通过什么来编写 ...
ContourBuilderForTin doesn't like coordinates of zero, 10, 2021-03-16, 2022-09-22. Expose SimpleTriangle Circumcircle, 4, 2021-02-22, 2022-09-21.
Read more >
TriangularFacetInterpolator: valid average formula?,about ...
In which case the triangle is degenerate (has area zero). ... HOT 4; ContourBuilderForTin doesn't like coordinates of zero HOT 10; TriangleCollector.
Read more >
Tinfour - githubmemory
ContourBuilderForTin doesn't like coordinates of zero. Previous Next. Make software development more efficient, Also welcome to join our telegram.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found