cljts icon indicating copy to clipboard operation
cljts copied to clipboard

within? relation doesn't seem to be working with decimal coordinates

Open sukhendu opened this issue 10 years ago • 3 comments

user=> (let [x (point (c 92 8)) pp (polygon (linear-ring [(c 85 0), (c 90 10), (c 100 0), (c 85 0)]) nil)] (cljts.relation/touches? x pp)) true ;; above coordinates divided by 100 user=> (let [x (point (c 0.92 0.08)) pp (polygon (linear-ring [(c 0.85 0.0), (c 0.90 0.10), (c 1.0 0.0), (c 0.85 0.0)]) nil)] (cljts.relation/touches? x pp)) false

sukhendu avatar Feb 27 '15 23:02 sukhendu

using wrong syntax

sukhendu avatar Feb 28 '15 00:02 sukhendu

Actually, the problem exists (see eg above). There seems a precision issue with jts lib?

sukhendu avatar Feb 28 '15 01:02 sukhendu

I think so. Tested with latest JTS and different PrecisionModel, the result is identical. Does JTS have an issue board or mailing-list for this?

sunng87 avatar Feb 28 '15 03:02 sunng87