Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jts-dev] Nearest point to a polygon is not contained by its exterior ring when using precission model

Dear JTSers,
I'm faced with a problem and I hoped someone with more experience could lend me a hand. 
I have a point A and a polygon. I need point A to be in the border of the polygon, so I "correct" it using DistanceOp.NearestPoints(). I want to keep this new coordinate as a point for further operations, and as I use a precision model I have to use PrecisionModel.MakePrecise on the coordinate (The type used is FIXED(1000)). The problem is that the new created point is not necessarily aligned with the border of the polygon so polygon.getExteriorRing().covers(correctedPoint) might be false. The same with intersects.
I would like to find a way of respecting the PrecisionModel while being able to validate that the point is in the border of the polygon. Does anyone have any ideas on how I could solve this?
Thanks for your time and help!
Kind regards,
Meyer M

Back to the top