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

Support z-coordinate as input for @turf/pointplane #754

Merged
merged 2 commits into from
May 24, 2017

Conversation

dpmcmlxxvi
Copy link
Collaborator

Addresses #628 for @turf/pointplane. PR has the following edits:

  • Uses z-coordinate if triangle properties a, b, or c are undefined. So, should be backwards compatible.
  • Replaces original test with simpler more meaningful test values. Besides, original test was only testing for a truthy response. Using simpler coordinates seemed easier to verify.
  • Updated test.js and bench.js syntax to ES6.

@DenisCarriere Let me know if this is what you had in mind.


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.

dpmcmlxxvi and others added 2 commits May 23, 2017 22:26
- Simplify tests & benchmark
- Refactoring index
- Update typescript
@DenisCarriere
Copy link
Member

@dpmcmlxxvi 👍 Yep that's what I had in mind to support Z coordinates.

My last commit added Geometry support using @turf/invariant to normalize the input.

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!

@dpmcmlxxvi
Copy link
Collaborator Author

@DenisCarriere Thanks for the review/edits. On the inputs, it now accepts an array for the input point. I thought the general philosophy of Turf was to have only GeoJSON as input and output for geographical features.

@DenisCarriere
Copy link
Member

DenisCarriere commented May 24, 2017

@dpmcmlxxvi Agreed, however the Point is the only exception since many times your point data will consist of [x, y] and not be in a Geometry/Feature (it's a pain having to convert your point data to Geometry or Feature if the only valid input is a point).

Rules to allow Array<number>

If the input is ONLY a point and you must use getCoord method from @turf/invariant which applies point validation.

@DenisCarriere DenisCarriere merged commit 22bfce6 into master May 24, 2017
@DenisCarriere DenisCarriere deleted the update-pointplane branch May 24, 2017 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants