Grab the geometry centroid - from each geometry; procude a delta x and a delta 
y between the two centroids, and then calc he angle using the Math atan2 
function 
(http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Math.html#atan2(double,%20double)).

This is the direction.

I think JTS may also have an angle utility class that may be easier. Here it is:

http://www.vividsolutions.com/jump/javadoc/com/vividsolutions/jump/geom/Angle.html#angle(com.vividsolutions.jts.geom.Coordinate,%20com.vividsolutions.jts.geom.Coordinate)



Jody

On 02/09/2010, at 8:00 PM, Feras Odeh wrote:

>  
> I’m trying to solve this problem But I reach to a point where I can  get the 
> intersection features  but how could I get the direction of each feature 
> relative to the selected feature?
>  
> Thanks
> Feras
> From: Jody Garnett [mailto:[email protected]] 
> Sent: Sunday, August 29, 2010 5:38 PM
> To: Feras Odeh
> Cc: [email protected]
> Subject: Re: [Geotools-gt2-users] How to navigate through shapefile parcels
>  
> Have you been through the docs on the website yet? The query tutorial will 
> let you request features which touch the current one.
>  
> Jody
>  
> On 29/08/2010, at 5:28 PM, Feras Odeh wrote:
> 
> 
> Thanks Jody..
>  
> Is there a tutorial to show me how to do that as I’m new to geo tools?
>  
> Thanks
> Feras
>  
> From: Jody Garnett [mailto:[email protected]] 
> Sent: Friday, August 27, 2010 4:57 AM
> To: Feras Odeh
> Cc: [email protected]
> Subject: Re: [Geotools-gt2-users] How to navigate through shapefile parcels
>  
> You can do a query to see which features "touch" the current one. Determining 
> what direction each parcel is in may be a bit of fun (take the angle between 
> the centroid of each feature? what about a parcel that surrounds another 
> parcel (often seen with lakes surrounded by private land).
>  
> You can also set up a graph based on the touch relationship; but I am not 
> sure how useful that would be.
>  
> Jody
>  
>  
> On 26/08/2010, at 4:37 PM, Feras Odeh wrote:
> 
> 
> 
> Hello..
>  
> I have a multi polygon  shape file for a country  every polygon represent a 
> parcel. If I ‘m now on a selected parcel is there a way to navigate through 
> parcels –i.e gets the south parcel , north one ……-?
>  
> Thanks
> Feras
> ------------------------------------------------------------------------------
> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
> Be part of this innovative community and reach millions of netbook users 
> worldwide. Take advantage of special opportunities to increase revenue and 
> speed time-to-market. Join now, and jumpstart your future.
> http://p.sf.net/sfu/intel-atom-d2d_______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>  
>  

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to