Contains or within 
- 
http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/Geometry.html#contains(com.vividsolutions.jts.geom.Geometry)

If you have a bunch to test use a prepared geometry for speed (so it does not 
have to recreate the edge graph each time). For a discussion see here:
- 
http://docs.geotools.org/latest/userguide/library/jts/dim9.html#preparedgeometry

Also there *just* point in polygon you can use the class directly:
- IndexedPointInAreaLocator 
(http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/algorithm/locate/IndexedPointInAreaLocator.html)

Also note that the same relationship (ie contains) can be used with a GeoTools 
Query when asking for polygons from a feature source.

See the "Use a point for to Check Polygon Layers" example here:
- http://docs.geotools.org/latest/userguide/library/main/filter.html (it 
includes pictures of what is going on)

-- 
Jody Garnett


On Monday, 11 July 2011 at 7:07 AM, Ted Yu wrote:

> I went over the methods in Geometry interface and didn't find a method which 
> can tell whether a point is inside a Geometry.
> 
> How can I do that ?
> 
> Thanks
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security 
> threats, fraudulent activity, and more. Splunk takes this data and makes 
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected] 
> (mailto:[email protected])
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to