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

Fix for boolean-contains #923

Merged
merged 5 commits into from
Sep 1, 2017
Merged

Fix for boolean-contains #923

merged 5 commits into from
Sep 1, 2017

Conversation

rowanwins
Copy link
Member

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Have read How To Contribute.
  • Run npm test at the sub modules where changes have occurred.
  • Run npm run lint to ensure code style at the turf module level.

Resolves #915 and introduces new tests against JSTS based on discussions in #919 .

I've left the shapely tests in there for reference but currently 13 of the tests fail when run against shapely

@rowanwins
Copy link
Member Author

Just a bit of additional context on performance of this module vs jsts equivalent. I've just done a random selection of the benchmark but I think the results speak for themselves :)

LineIsNotContainedByLine x 1,634,071 ops/sec ±0.70% (88 runs sampled)
LineIsNotContainedByPolygonBoundary x 795,088 ops/sec ±1.31% (87 runs sampled)
MultiPointsOnLineEndsIsNotContainedByLine x 1,634,158 ops/sec ±1.81% (81 runs sampled)
MultiPointAllOnBoundaryIsNotContainedByPolygon x 2,276,602 ops/sec ±1.29% (91 runs sampled)
PointIsNotContainedByLine x 5,073,211 ops/sec ±1.22% (85 runs sampled)
PointOnEndIsContainedByLinestring x 4,761,148 ops/sec ±1.43% (91 runs sampled)
PointIsNotContainedByPolygon x 2,157,777 ops/sec ±1.28% (87 runs sampled)
Polygon-Polygon x 1,568,971 ops/sec ±2.94% (85 runs sampled)
LineIsContainedByLine x 1,454,283 ops/sec ±3.07% (84 runs sampled)
LineIsContainedByPolygon x 963,701 ops/sec ±3.48% (84 runs sampled)
MultipointsIsContainedByLine x 2,084,209 ops/sec ±2.85% (87 runs sampled)
MultiPointsEqual x 6,362,304 ops/sec ±3.13% (85 runs sampled)
PointIsContainedByLine x 5,894,413 ops/sec ±0.70% (91 runs sampled)
PointInsidePolygonBoundary x 2,130,683 ops/sec ±2.64% (82 runs sampled)


JSTS:LineIsNotContainedByLine x 567,455 ops/sec ±1.67% (89 runs sampled)
JSTS:LineIsNotContainedByPolygonBoundary x 355,026 ops/sec ±1.31% (87 runs sampled)
JSTS:MultiPointsOnLineEndsIsNotContainedByLine x 17,324 ops/sec ±42.43% (82 runs sampled)
JSTS:MultiPointAllOnBoundaryIsNotContainedByPolygon x 254,955 ops/sec ±2.59% (88 runs sampled)
JSTS:PointIsNotContainedByLine x 583,935 ops/sec ±1.14% (92 runs sampled)
JSTS:PointOnEndIsContainedByLinestring x 27,216 ops/sec ±1.20% (89 runs sampled)
JSTS:PointIsNotContainedByPolygon x 484,963 ops/sec ±1.09% (90 runs sampled)
JSTS:Polygon-Polygon x 384,874 ops/sec ±0.83% (89 runs sampled)
JSTS:LineIsContainedByLine x 14,320 ops/sec ±2.52% (91 runs sampled)
JSTS:LineIsContainedByPolygon x 343,904 ops/sec ±1.14% (94 runs sampled)
JSTS:MultipointsIsContainedByLine x 21,823 ops/sec ±1.27% (90 runs sampled)
JSTS:MultiPointsEqual x 38,901 ops/sec ±1.13% (90 runs sampled)
JSTS:PointIsContainedByLine x 23,097 ops/sec ±1.39% (91 runs sampled)
JSTS:PointInsidePolygonBoundary x 378,368 ops/sec ±1.37% (92 runs sampled)

Copy link
Member

@DenisCarriere DenisCarriere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me

@DenisCarriere
Copy link
Member

Those benchmark results definitely speak for themselves 👍 good job @rowanwins

@stebogit
Copy link
Collaborator

@rowanwins impressive! 😜 👍

@DenisCarriere DenisCarriere merged commit b35d15e into master Sep 1, 2017
@DenisCarriere DenisCarriere deleted the boolean-contains-patch branch September 1, 2017 17:55
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

Successfully merging this pull request may close these issues.

3 participants