Thank you to all for your answer
By combining Distance, orientation index of JTS , I manage to do the job.
Nicolas
_____
De : Duane Zamrok [mailto:[email protected]]
Envoyé : vendredi 3 décembre 2010 12:07
À : Craig Taverner; [email protected]
Cc : [email protected]
Objet : RE: [Geotools-gt2-users] test left/right position
A caveat which hasn't been mentioned as yet is that JTS assumes you're in a
Euclidean space, and so it won't realize that the point -179, 30 is to the left
of the line 170, 30 -> 170, 40. You will need to handle the corner case where
the world wraps on your own.
-Duane
From: Craig Taverner [mailto:[email protected]]
Sent: Thursday, December 02, 2010 6:33 AM
To: [email protected]
Cc: [email protected]
Subject: Re: [Geotools-gt2-users] test left/right position
JTS has a function for snapping to the closest point on the line. You could use
that to first find the closest line segment and then perform the orientation
index to that.
On Thu, Dec 2, 2010 at 10:22 AM, <[email protected]
<mailto:[email protected]> > wrote:
Hello Balint,
Thank you for your help,
This JTS pointer will help me.
Even if it does not completely answer to my problem (my first post was
incomplete, sorry for this).
The CGAlgorithms.orientationIndex computes position point against
a simple oriented line.
But what about a linestring like this:
A--------B
|
| E------------>
| |
| X |
C---------D
In this case the X point is on the LEFT of the geometry.
Although CGAlgorithms.orientationIndex(A,B,X) returns RIGHT.
I will try to implement an algorithm for that.
But it would have been great if JTS provide such a calculation.
Thank you again
Nicolas.
-----Message d'origine-----
De : Balint Persics [mailto:[email protected] <mailto:[email protected]> ]
Envoyé : mercredi 1 décembre 2010 21:33
À : nicolas.lecart
Cc : geotools-gt2-users
Objet : Re: [Geotools-gt2-users] test left/right position
Hello,
I think this is not GeoTool's job, it's a topology problem. I suggest
using JTS to solve this problem:
com.vividsolutions.jts.algorithm.CGAlgorithms.orientationIndex(Coordinate
p1,Coordinate p2, Coordinate q) will do the job.
Hope that helps,
Balint
On Wed, Dec 1, 2010 at 14:55, <[email protected]
<mailto:[email protected]> > wrote:
> Hello,
>
> I am wondering if geotools provides function to test if a point is on the
> left or on the right of an oriented line (implemented trough a LineString
> for instance).
>
> For example, in this case:
>
> ------------------>
> x
>
> the point "x" is on the right of the oriented line
>
> but in this case:
>
> <------------------
> x
>
> the point "x" is on the left of the oriented line
>
> thank you
>
> Nicolas
>
> ------------------------------------------------------------------------------
> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
> Tap into the largest installed PC base & get more eyes on your game by
> optimizing for Intel(R) Graphics Technology. Get started today with the
> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
> http://p.sf.net/sfu/intelisp-dev2dev <http://p.sf.net/sfu/intelisp-dev2dev>
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> <https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users>
>
--
Persics Balint
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev <http://p.sf.net/sfu/intelisp-dev2dev>
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
<https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users>
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users