What you are looking for is in the graph package, it builds up a graph (or network) based on a relationship (like touch as you mentioned). Armed with this data structure you can answer questions like the one you asked, and you can also perform nifty things like figuring out the shortest distance between two geometries along the graph.

Cheers,
Jody

Sean McGowan wrote:
Does anybody know a method in Geotools that can return an arrray of geometries that touch a given geometry? I know the Geometry method g1.touch(g2) can determine if two given geometries touch. What I want is a method to return all touching geometries. I had a look through the JTS API but couldn't find one. If there's no existing code, I'll write my own. I just wanted to check first.

It could be something like this:

Geometry[] g = g1.getTouchingGeometries();

I'll implement my own if none exists.

Thanks,
Sean




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to