1

I am allowing users to draw a polygon using the ol.interaction.Draw control. I want to make sure that the drawn polygon is not self intersecting.

I found a way how to do this in openlayers 2 in this topic: https://gis.stackexchange.com/questions/23755/determine-if-a-polygon-intersects-itself-in-openlayers

I was wondering IF there is a (better?) way to do this in openlayers 3 OR if somebody can guide me how to do this using openlayers 3 as I seem to be unable to port the openlayers 2 example.

Thank you in advance

Community
  • 1
  • 1
stvn
  • 1,148
  • 1
  • 8
  • 24
  • It may help you http://gis.stackexchange.com/questions/147829/how-to-check-for-geometry-intersection-point-in-polygon-using-openlayers3 – Naghaveer R Dec 20 '16 at 18:15
  • thanks but I want to check if the polygon intersects with itself. Your link is to intersect 2 polygons. I've been looking at a turf.js solution for this but I am having trouble there with polygons drawn by freehand and the following link is not a fix: http://stackoverflow.com/questions/38599863/turf-js-intersect-error-for-self-intersecting-polygons-from-openlayers3-draw – stvn Dec 20 '16 at 20:37
  • to further elaborate on this issue, using turf I get false positives on the kinks method when freehand drawing a polygon because the draw interaction seems to randomly render multiple point features at the same coordinates for the same polygon vertices. – stvn Dec 20 '16 at 21:31

0 Answers0