Hello all,

Just to add a little more to Andy's points in case it is useful...

> 1. For JTS contains it clearly states (in the link Jody provided), that the 
> test is that the
> geometry is within the boundary of the other geometry and that it regards any 
> point on
> the boundary to mean the geomerty is not contained.

You can use the Geometry.covers or Geometry.coveredBy methods to allow
for points on the boundary...
http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/Geometry.html#covers(com.vividsolutions.jts.geom.Geometry)

> 2. If precision is very important and you are for instance dealing with small 
> differences
> in coordinates represented by large numbers, you may have issues due to 
> inaccuracy.
> I think the JTS implementation relies on a precision model that cannot 
> guarantee an
> accurate result in all cases.

If the coordinates are all large numbers, but are not spread over a
large range, you can get better effective precision by centering them
on the origin (subtracting the common mean from all coordaintes).

Alternatively, if you are creating the Geometry objects you can pass a
specific PrecisionModel to GeometryFactory...
http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/geom/PrecisionModel.html

Finally, in JTS 1.12 there is a new GeometryPrecisionReducer class
which might be relevant to your case...
http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/precision/GeometryPrecisionReducer.html

Hope this helps,
Michael

------------------------------------------------------------------------------
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