Hi Jody,
Thank you very much for the detailed message. I really appreciate it. I will
take a closer look to the links and examples your are pointing me to.
To answer your question:
*Thinking - are you talking the graph module here (that is do you want
to build a network) or are you just trying to find matches?*
Yes, I am trying to build a graph representation of the global ecological
regions from the shapefile that I have. Therefore, I need to consider any
spatial relationships between two regions (touches, intersects, whatever
else). When the graph is built, I will use it in assessing how human
activities travels from one region to another based on whether they touch,
intersect, etc. This is precisely what I am trying to do.
Thanks again!
Ahmed
On Tue, Mar 23, 2010 at 6:53 PM, Jody Garnett <[email protected]>wrote:
> > Hi Jody,
> > Yes, I have looked at the wiki! The wiki only mentions the "touches"
> > relationship. It doesn't show you how to extract this "touches" property
> in
> > the shapefile.
>
> You need to look at the Geometry class to sort out the different
> relationships. touches is a method on the geometry class (ie Polygon).
>
> > So, I need to know how to find out from a shapefile if two
> > polygons are touching. This is the question that I am trying to answer.
>
> Thinking - are you talking the graph module here (that is do you want
> to build a network) or are you just trying to find matches?
>
> You may wish to use a for loop and go through the shapefile multiple times;
> - it take one polygon out ,,,
> - use it to query the shapefile a second time to find other polygons that
> touch
> - continue ...
>
> Reading:
> - http://docs.codehaus.org/display/GEOTDOC/06+FeatureSource
> -
> http://docs.codehaus.org/display/GEOTDOC/12+Using+a+Loop+to+Join+FeatureCollections
>
> > Another question, what is the difference between a 4 points ploygon and a
> 5?
> >
> > Polygon p1 = createPolygon("0 0,1 1,2 2,0 0");// 4 points
> > Polygon p2 = createPolygon("0 0,5 0,5 5,0 5,0 0"); // 5 points
>
> Not sure I understand they are two different polygons...
>
> For background reading on how geometry comparisons are performed:
> - http://docs.codehaus.org/display/GEOTDOC/03+JTS+Topology+Suite
> -
> http://docs.codehaus.org/display/GEOTDOC/Point+Set+Theory+and+the+DE-9IM+Matrix
>
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users