Why not just use the intersects() method on your constructed Geometrys? Otherwise, I'd need some runnable code to test this. You could also provide the exception stack trace.

Frank Hardisty wrote:
Dear Martin and All,

I have been trying to create multipolygons from java.awt.GeneralPath
objects. I want to use JTS in order to find out which shapes touch
which ones, and to find their centroids. I am using the 1.8 release.
However, I get NullPointerExceptions, and I can't understand why. So,
if  Martin or someone else could help me understand where I have gone
wrong, in either my general approach, or the specifics of my code, I
would appreciate it.

I have been using the JTS JavaDocs and the 1.4 developers' guide. I
could not find a way to search the current discussion archives, is
there a way to do this?

My approach is as follows

1. turn x,y values into Coordinate[]
2. turn Coordinate[] into LinerRing[]
3. turn LineString[] into Polygon[]
4. turn Polygon[] into MultiPolygon
5. two ideas here: use the computeEdgeIntersections method of
SegmentIntersector, or use a RelateComputer to find if two
MultiPolyons touch.

However, using either approach listed in 5, I get NullPointerExceptions. Help!

I'll paste in my code below.

thanks again,
-Frank




--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

_______________________________________________
jts-devel mailing list
jts-devel@lists.jump-project.org
http://lists.refractions.net/mailman/listinfo/jts-devel

Reply via email to