Handling when start and end points in same polygon