I was just about to find this method. Thanks Larry!
From: Larry Becker
Sent: Wednesday, December 31, 2008 12:04 AM
To: OpenJump develop and use
Subject: Re: [JPP-Devel] geometry intersection
Isn't it just:
// read a geometry from a WKT string (using the default geometry factory)
Geometry g1 = new WKTReader().read("LINESTRING (0 0, 10 10, 20 20)");
System.out.println("Geometry 1: " + g1);
// create a geometry by specifying the coordinates directly
Coordinate[] coordinates = new Coordinate[]{new Coordinate(0, 0),
new Coordinate(10, 10), new Coordinate(20, 20)};
// use the default factory, which gives full double-precision
Geometry g2 = new GeometryFactory().createLineString(coordinates);
System.out.println("Geometry 2: " + g2);
// compute the intersection of the two geometries
Geometry g3 = g1.intersection(g2);
Larry
On Tue, Dec 30, 2008 at 9:52 AM, Bing Ran <[email protected]> wrote:
Hi JTS experts,
What's the way to get the geometry of the intersection area of two
geometries? I don't find anything in the Geometry class.
Help is appreciated!
Bing
------------------------------------------------------------------------------
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
--
http://amusingprogrammer.blogspot.com/
--------------------------------------------------------------------------------
------------------------------------------------------------------------------
--------------------------------------------------------------------------------
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
------------------------------------------------------------------------------
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel