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

Documentation: Supporting "meters" unit #1298

Closed
ozomer opened this issue Mar 6, 2018 · 7 comments · May be fixed by #2694
Closed

Documentation: Supporting "meters" unit #1298

ozomer opened this issue Mar 6, 2018 · 7 comments · May be fixed by #2694
Assignees
Labels

Comments

@ozomer
Copy link

ozomer commented Mar 6, 2018

Hi,
All operations that accepts units of "degrees, radians, miles, or kilometers" can also accept "meters".
One of our developers called distance with unit "kilometers" and divided the result by 1000, because the documentation did not specify that it supports meters too.

Minor issue, not critical...

@rowanwins
Copy link
Member

Thanks for the report @ozomer , good pickup!

@rowanwins rowanwins added the docs label Mar 6, 2018
@rowanwins rowanwins self-assigned this Mar 6, 2018
@DenisCarriere
Copy link
Member

Meters is included in the source code:

https://github.com/Turfjs/turf/blob/master/packages/turf-helpers/index.mjs#L10-L11
https://github.com/Turfjs/turf/blob/master/packages/turf-helpers/index.d.ts#L20

I agreed that we could add "meters" in the docs, however we shouldn't include every single unit of measurement in the docs (keep it short & simple).

@andrewharvey
Copy link
Contributor

I've always been converting meters to kilometers since I didn't know meters is supported too.

I agreed that we could add "meters" in the docs, however we shouldn't include every single unit of measurement in the docs (keep it short & simple).

I disagree, the documentation should document all supported options.

@mfedderly
Copy link
Collaborator

I'd love to have the documentation be accurate everywhere but that involves a bunch of duplication that our docs aren't setup for right now. As a half measure, the typescript types reference the canonical list, so any typescript consumers will now get the full list.

@smallsaucepan
Copy link
Member

Would this be a suitable approach? Rather than list all options on every function, add a centralised list and embed a link in the Description field. Publicises that other options are available without cluttering up the API documentation.

Screenshot 2023-08-18 at 3 02 15 pm

The full list:

Screenshot 2023-08-18 at 3 02 24 pm

Would do the same for area related units.

@twelch
Copy link
Collaborator

twelch commented Aug 18, 2023

@smallsaucepan I'm open to this approach if you want to give it a try. Holler if you have questions

@smallsaucepan
Copy link
Member

The Units typedef now has it's own page on the website: https://turfjs.org/docs/next/api/types/Units As we update documentation for each method they'll begin to link to the full list of options automatically.

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

Successfully merging a pull request may close this issue.

7 participants