Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lineCross function is resulting in a false positive #12

Closed
Pranava29 opened this issue Dec 26, 2018 · 3 comments
Closed

lineCross function is resulting in a false positive #12

Pranava29 opened this issue Dec 26, 2018 · 3 comments

Comments

@Pranava29
Copy link

Pranava29 commented Dec 26, 2018

Hi,
The following line segments do not actually intersect but the lineCross utility is returning a false positive.

{
        "type": "LineString",
        "coordinates": [
          [
            -71.1884310511,
            42.3219864254
          ],
          [
            -71.1884310511,
            42.321998793
          ]
        ]
      }
{
        "type": "LineString",
        "coordinates": [
          [
            -71.1884310515,
            42.3221529806
          ],
          [
            -71.1884310517,
            42.3222331303
          ]
        ]
      }

screen shot 2018-12-27 at 12 05 54 am

@Pranava29
Copy link
Author

@jillesvangurp , any update on this? Please let me know if you need any more analysis information.

@jillesvangurp
Copy link
Owner

I'm not actively working on this project for a few years now; limited time for side projects currently. Feel free to create a pull request to address this.

@jillesvangurp
Copy link
Owner

I finally looked into this, the lines actually do intersect but the segments do not.

  • line 1 is vertical
  • line2 intersects line1 at -71.1884310511,42.32199266925454
  • 42.32199266925454 is in between 42.3219864254 and 42.321998793, this is why the check passes
  • however, this is NOT in between 42.3221529806 and 42.3222331303 of line2 so the intersection point is outside of that. This is the bug and we need to check both line segments. Pushing a fix soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants