* Configure ESlint and Prettier
- Disable all eslint rules that trigger
- Build's lint step now runs monorepoint, prettier, and eslint
- Remove all tslint references
* [auto] run prettier on everything
Co-authored-by: Matt Fedderly <mfedderly@palantir.com>
The existing buffer code has three problems:
- it uses two different projections depending on the latitude of the
input geometry. This results in an error discontinuity at 50N.
- it switches projections only for the northern hemisphere.
- it mistakenly reverses the lonlat center, which has the eventual
result of rotating the projection to a skewed center.
The third problem is one of the causes of `buffer`'s size issues. At
latitudes above 50N, the projection distorts input distances due to not
being rotated to the correct input geometry center. At latitudes below
50N, the Mercator projection does not receive a correction for the input
distance. If using the Mercator projection, the actual distance used
as an input to JSTS BufferOp should be distance / cos((lat * π) / 180). [1]
As recommended in the original[2] exploration that prompted the fix
introduced in #938, this patch switches the buffer prep code to
consistently using the Azimuthal Equidistant projection rather than
switching between Mercator and Transverse Mercator. When centered on the
input geometry, this projection should produce less distortion in all
directions for input geometries of reasonable size compared to a
cylindrical one.
I took the opportunity to optimize slightly; buffering now calls
`center` only once, and we don't need to `bbox` the input geom at all.
[1] https://gis.stackexchange.com/a/347573
[2] https://github.com/w8r/moscow-rings#solution
Co-authored-by: Rowan Winsemius <rowanwins@yahoo.com.au>
Co-authored-by: mfedderly <mdfedderly@mdfedderly.com>
- required files
- test.js
- bench.js
- index.js
- index.d.ts
- README.md
- types.ts (optional for now)
- invalid dependencies (should be used as devDependencies)
- tape
- benchmark
- eslint (handled at root level)
- strict version dependencies
- jsts (v1.3.0)
- duplicated dependencies (also included in devDependencies)
- check if `files` exists from package.json
- Confirm MIT license
- correct scoped name `@turf/module-name`
- Pre-defined attributes in package.json
- Parsing dependencies from `index.js`
- require('module') should be included in `dependencies` in package.json
- no duplicate `require` (ex: only require `@turf/helpers` once)
- Project coordinates to TransverseMercator centered on GeoJSON to performe distance buffer in meters
- Added a few more input validation
- Dropped `@turf/dissolve` since jsts was faster with multiPoint
- Add Geometry Object tests
- Add prevent input mutation tests
* Earth radius updated
Earth radius updated as per official google earth radius.
* Line spacing error fixed
Line spacing error fixed
* Update test cases that depend on helpers
@ath0mas Sorry for the late merge, I've tested it against Node v7.X and your branch is working on my local environment & CircleCI.
FYI: The latest TurfJS master branch is failing when I'm running the tests Node v7.X (MacOSX).
* move stuff to test
* simplify code
* remove bad use of 'set' in a bunch of places. we aren't dealing with
sets.
* ugh the family in front of me doesn't understand timezones and speaks
at 80db