Sorry emailed in the wrong thread. On Tue, Jun 1, 2010 at 12:17 PM, Enamul Haque <[email protected]> wrote: > Issues painting 1337 > com.vividsolutions.jts.geom.TopologyException: found non-noded intersection > between LINESTRING ( 425.3577964292566 353.3573056447468, 422.9709927080371 > 352.5320418023972 ) and LINESTRING ( 424.7158612767181 353.2581028560069, > 424.51008809832365 352.09491883682944 ) [ (424.69273075149505, > 353.1273518149598, NaN) ] > at > com.vividsolutions.jts.noding.FastNodingValidator.checkValid(FastNodingValidator.java:109) > at > com.vividsolutions.jts.geomgraph.EdgeNodingValidator.checkValid(EdgeNodingValidator.java:94) > at > com.vividsolutions.jts.geomgraph.EdgeNodingValidator.checkValid(EdgeNodingValidator.java:59) > at > com.vividsolutions.jts.operation.overlay.OverlayOp.computeOverlay(OverlayOp.java:170) > at > com.vividsolutions.jts.operation.overlay.OverlayOp.getResultGeometry(OverlayOp.java:127) > at > com.vividsolutions.jts.operation.overlay.OverlayOp.overlayOp(OverlayOp.java:66) > at > com.vividsolutions.jts.operation.overlay.snap.SnapOverlayOp.getResultGeometry(SnapOverlayOp.java:67) > at > com.vividsolutions.jts.operation.overlay.snap.SnapOverlayOp.overlayOp(SnapOverlayOp.java:24) > at > com.vividsolutions.jts.operation.overlay.snap.SnapIfNeededOverlayOp.getResultGeometry(SnapIfNeededOverlayOp.java:76) > at > com.vividsolutions.jts.operation.overlay.snap.SnapIfNeededOverlayOp.overlayOp(SnapIfNeededOverlayOp.java:25) > at com.vividsolutions.jts.geom.Geometry.intersection(Geometry.java:1150) > at > org.geotools.renderer.label.LabelCacheImpl.paintPolygonLabel(LabelCacheImpl.java:1119) > at > org.geotools.renderer.label.LabelCacheImpl.paintLabels(LabelCacheImpl.java:586) > at > org.geotools.renderer.label.LabelCacheImpl.end(LabelCacheImpl.java:520) > at > org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:711) > at > org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:551) > at > org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:469) > at > com.redknee.app.els.shape.display.component.MapPane.paintComponent(MapPane.java:252) > at > com.redknee.app.els.shape.display.component.ZoomPane$1.paint(ZoomPane.java:432) > at javax.swing.plaf.ComponentUI.update(Unknown Source) > at javax.swing.JComponent.paintComponent(Unknown Source) > at > com.redknee.app.els.shape.display.component.ZoomPane.paintComponent(ZoomPane.java:2004) > at javax.swing.JComponent.paint(Unknown Source) > at javax.swing.JComponent.paintToOffscreen(Unknown Source) > at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown > Source) > at javax.swing.RepaintManager$PaintManager.paint(Unknown Source) > at javax.swing.RepaintManager.paint(Unknown Source) > at javax.swing.JComponent._paintImmediately(Unknown Source) > at javax.swing.JComponent.paintImmediately(Unknown Source) > at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) > at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) > at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source) > at > javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown > Source) > at java.awt.event.InvocationEvent.dispatch(Unknown Source) > at java.awt.EventQueue.dispatchEvent(Unknown Source) > at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) > at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) > at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) > at java.awt.EventDispatchThread.pumpEvents(Unknown Source) > at java.awt.EventDispatchThread.pumpEvents(Unknown Source) > at java.awt.EventDispatchThread.run(Unknown Source) > > I have been seeing a lot of these exceptions lately. I'm using the latest > 2.6.4 and this probably didn't happen in 2.4.x that I was using before. I > checked with isValid() method and they are said to be all valid. Therefore, > the original shape is valid. I found that this particular piece of code from > LabelCacheImpl is causing the issue: > > PreparedGeometry pg = PreparedGeometryFactory.prepare(geom); > // if(!pg.contains(centroid)) { > // Envelope env = geom.getEnvelopeInternal(); > // LineString bisector = geom.getFactory().createLineString(new > Coordinate[] { > // new Coordinate(env.getMinX(), centroid.getY()), > // new Coordinate(env.getMaxX(), centroid.getY()) }); > // Geometry intersection = bisector.intersection(geom); > // Envelope widestEnv = > widestGeometry(intersection).getEnvelopeInternal(); > // double midX = (widestEnv.getMinX() + widestEnv.getMaxX()) / 2; > // centroid = geom.getFactory().createPoint(new Coordinate(midX, > centroid.getY())); > // } > > I have commented out these lines to have a temporary workaround to this > problem. > >
------------------------------------------------------------------------------ _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
