I've played around with the Filters some more (as was suggested), and I still 
can't seem to find what I'm looking for. If you'll please excuse my use of a 
list, I think it will be helpful to better outline my problem.

Problem:
I start out with a polygon defined as a closed line string of longitude 
latitude points.
After starting, I begin to receive longitude/latitude coordinates, one at a 
time through web service calls.
I want to determine if the longitude/latitudes I'm receiving are located inside 
of the polygon I started with.

Given:
JTS is a 2.5D Cartesian geometry computation library. It is not capable of 
understanding that 180 lies between -170 and 170.

Need: (I think)
A 2D Cartesian coordinate system to represent my points in.


It seems to me that while this might not be an easy problem, it is likely a 
classic problem. I've talked to people who suggested NED, but given that my 
points can be located anywhere on the earth I understand that NED's accuracy is 
extremely skewed given a large distance. (it's local horizon isn't it?). I 
appreciate all the help I've received already and thank you in advance for any 
more direction you might provide me.

Thank You
-Duane



-----Original Message-----
From: Ian Turton [mailto:ijtur...@gmail.com]
Sent: Wednesday, May 19, 2010 2:25 PM
To: Duane Zamrok
Cc: geotools-gt2-users@lists.sourceforge.net
Subject: Re: [Geotools-gt2-users] WGS84 Point in Polygon

On Wed, May 19, 2010 at 2:19 PM, Duane Zamrok <zam...@cubrc.org> wrote:
> Thank you for the quick response, but I think you may have misunderstood my 
> question. The link that you sent me appears to deal with querying a database 
> for items whose location is within the bounds of a bounding box.

The last example contains the line
 polyCheck=ff.not(ff.disjoint(ff.property("the_geom"),ff.literal(
feature.getPrimaryGeometry() )));

which should be what you want. The joy of GeoTools is that it
abstracts the datastore you are using away from your code so it won't
matter what store you use, the code at the bottom of that page will
work on it.

>However, I'm not working with a database and my problem is much more closely 
>related to what coordinate system I should be using to perform the 
>calculations. From what I've read of JTS it is strictly a Cartesian geometry 
>library. It is unable to handle the transitions from -180 to 180 on the 
>longitude axis or the transition from -90 to 90 on the latitude axis. This 
>prompts me to believe that I must somehow transform my coordinates before 
>creating the polygon and doing the computation. However, I'm not sure what 
>coordinate system I should be using to maintain accuracy.
>

Someone else may be able to help you with that, I don't know if our
filters handle projections well (at all?).

Ian
--
Ian Turton

------------------------------------------------------------------------------

_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to