Okay as Martin was kind enough to point out; (d) was a mistake and did not mean the same thing as the others... I created a little test harness and tried each alternative from scratch; carefully ignoring the first couple of runs so the JIT compiler does not confuse things. If you want to see the raw data look at the end of this page: - http://docs.codehaus.org/display/GEOTDOC/Point+Set+Theory+and+the+DE-9IM+Matrix

The results are (for comparing 100 randomly generated little 2x2 squares arranged onto a 10x10 grid):
a) 230 mills geometry.disjoint( geometry2 ) || geometry.touches( geometry2 )
b) 341 mills matrix.isDisjoint() || matrix.isTouches(2,2)
c) 441 mills geometry.relate( geometry2, "F********" )

My guess would be that the explicit relationship methods on the JTS geometry objects are optimized and do not compute the full matrix; all other options cost about the same as they are based on computing the complete matrix and then asking questions about the result. I was hoping the relate method would notice my pattern only cared about the intersection of the interior ;-)

Thanks for everyones time,
Jody
_______________________________________________
jts-devel mailing list
jts-devel@lists.jump-project.org
http://lists.refractions.net/mailman/listinfo/jts-devel

Reply via email to