Turf/Buffer - More precise documentation of supported units for buffering#2218
Turf/Buffer - More precise documentation of supported units for buffering#2218marcjansen wants to merge 1 commit intoTurfjs:masterfrom
Conversation
|
|
||
| /** | ||
| * Calculates a buffer for input features for a given radius. Units supported are miles, kilometers, and degrees. | ||
| * Calculates a buffer for input features for a given radius. Units supported are: |
There was a problem hiding this comment.
Do you think that this is still a useful thing to add to the docs? I'd be inclined to just point users towards the typescript autocomplete for this field. Otherwise I'm mostly just concerned about keeping this list up to date with the actual definition in @turf/helpers. Maybe that's a silly concern since we probably don't often get new units of length.
There was a problem hiding this comment.
We should definitely try to avoid repeatedly listing all the options in the individual packages.
There might have been autocomplete issues in the past due to .js/.dts/JSDoc inconsistencies. For example, some places have Units in the function definition, but then just string in the JSDoc. Hopefully as we weed out the last few JS packages that will self resolve.
For this case maybe we say, leave any mention of units off completely. What do you think @marcjansen and @mfedderly?
This changes the documentation of the buffer module to list all supported units.
lengthToUnits(which is used when buffering) supports more than justmiles, kilometers, and degrees. I am not sure if this was not documented on purpose.I also wasn't sure whether I was supposed to commit the changed
README.mdas well.Please review.
Please fill in this template.
npm testat the sub modules where changes have occurred.npm run lintto ensure code style at the turf module level.Submitting a new TurfJS Module.Not applicable