1.13 polygonizer is crashing when I call getPolygons.

I am dealing with a very complex shape, with a lot of internal polygons 
and other pecularities. The input line lines are a projection of a 3D 
mesh with lots of overlaps. Since coords are in meters I have rounded 
them to nearest meter on entry. I have gone to bit of effort cleaning up 
all input linestring to remove self-intersection and "polygons" that are 
straight lines (zero area).  (union with a point on the line, put into 
polygonizer, extract back polygons). All inputs validate.

However, I am still getting polygonizer crash:
In log:
> java.lang.NullPointerException
>     at 
> com.vividsolutions.jts.geom.util.LinearComponentExtracter.getLines(LinearComponentExtracter.java:146)
>     at 
> com.vividsolutions.jts.geom.util.LinearComponentExtracter.getLines(LinearComponentExtracter.java:130)
>     at nz.cri.gns.tsurfist.tsurface.assembleEdges(tsurface.java:1171)
> in Test output
> java.lang.NullPointerException
>     at 
> com.vividsolutions.jts.algorithm.RayCrossingCounter.countSegment(RayCrossingCounter.java:134)
>     at 
> com.vividsolutions.jts.algorithm.RayCrossingCounter.locatePointInRing(RayCrossingCounter.java:80)
>     at 
> com.vividsolutions.jts.algorithm.CGAlgorithms.locatePointInRing(CGAlgorithms.java:167)
>     at 
> com.vividsolutions.jts.algorithm.CGAlgorithms.isPointInRing(CGAlgorithms.java:148)
>     at 
> com.vividsolutions.jts.operation.polygonize.EdgeRing.findEdgeRingContaining(EdgeRing.java:85)
>     at 
> com.vividsolutions.jts.operation.polygonize.Polygonizer.assignHoleToShell(Polygonizer.java:242)
>     at 
> com.vividsolutions.jts.operation.polygonize.Polygonizer.assignHolesToShells(Polygonizer.java:236)
>     at 
> com.vividsolutions.jts.operation.polygonize.Polygonizer.polygonize(Polygonizer.java:198)
>     at 
> com.vividsolutions.jts.operation.polygonize.Polygonizer.getPolygons(Polygonizer.java:143)
>     at nz.cri.gns.tsurfist.tsurface.assembleEdges(tsurface.java:1191)
>     at nz.cri.gns.tsurfist.tsurface.loadFromFile(tsurface.java:1317)
>     at nz.cri.gns.tsurfist.ProcessCmdLine.main(ProcessCmdLine.java:48)
>     at 
> nz.cri.gns.tsurfist.ProcessCmdLineTest.testMain(ProcessCmdLineTest.java:48)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>     at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:498)
>     at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
>     at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>     at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
>     at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
>     at 
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
>     at 
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
>     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
>     at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
>     at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
>     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
>     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
>     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
>     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
>     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
>     at 
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
>     at 
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
>     at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
>     at 
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
>     at 
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
>     at 
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>     at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:498)
>     at 
> org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
>     at 
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
>     at 
> org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
>     at 
> org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
>     at 
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)

A file with the offending validated rings can be found at:
https://drive.google.com/file/d/0B3lye8EN1ELEUVphVi1HNkl2VWs/view?usp=sharing

Removing certain (rather spiky) rings does allow the polygoniser to 
work, but doesnt give me a way to fix problems in advance.

Notice: This email and any attachments are confidential.
If received in error please destroy and immediately notify us.
Do not copy or disclose the contents.


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user

Reply via email to