31 Commits

Author SHA1 Message Date
mfedderly
2e9d3d51f7
Add Prettier and ESLint to the builds (#1965)
* 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>
2020-12-08 19:24:15 -05:00
Dmitriy Yakovlev
815d24138a
Use Azimuthal Equidistant projection for buffer, fix lnglat issue (#1956)
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>
2020-12-08 10:07:28 -05:00
Denis
13a8bed8f7 Update fixtures based on earthRadius change 2017-10-11 11:25:35 -04:00
Denis
531e856f2a Update earth radius 2017-10-11 11:14:27 -04:00
stebogit
10dc77eba6 adds test issue #815 2017-09-11 08:37:35 -07:00
stebogit
a7c6035703 adds test issue #916 2017-09-11 08:26:07 -07:00
stebogit
95cef56b10 uses transverse mercator above 50 degrees 2017-09-11 08:22:35 -07:00
stebogit
adee2d93de refactored with @turf/projection 2017-09-06 08:54:29 -07:00
Denis
92cf64a2ef Add test fixtures for #801
Ref: https://github.com/Turfjs/turf/issues/801
2017-06-19 13:22:18 -04:00
Denis
acc1308066 Buffer (#786)
Buffer - Drop circle buffer operation
2017-06-12 09:57:27 -04:00
Denis
312edb570d Add file management & package.json rules
- 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)
2017-05-17 23:16:55 -07:00
Denis
72ca3e7704 Colorize results & add negative buffer tests 2017-05-13 00:38:47 -04:00
Denis
c2bbd8ec6b Update Typescript definition @turf/buffer 2017-05-13 00:38:06 -04:00
Denis
a61897b5e3 Drop properties from featureCollection
Is fixed in next minor release
2017-05-06 21:59:45 -04:00
Denis
ce8bac807b Improve @turf/buffer with equi-distance
- 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
2017-05-06 21:15:22 -04:00
Denis
4b2e687440 turf-buffer add northern test polygon 2017-04-16 10:51:42 -04:00
Denis
3563f0a0e9 buffer units other than degrees #283 (#667)
* buffer units other than degrees #283

* Translate properties

* Update typescript definition
2017-04-15 20:51:44 -04:00
Denis
4485cee36c Add northern latitude test case for buffer 2017-04-10 11:01:12 -04:00
Denis
3755dfa94f turf-buffer update test cases 2017-04-10 01:09:13 -04:00
Denis
5967fd0e24 Revert distance back to 6371km (#645) 2017-04-05 18:49:11 -04:00
DhivehiMv
9785da3792 Earth radius updated (#636)
* 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
2017-03-29 23:48:48 -04:00
Denis
815f8d4c68 Major fixes to turf-buffer tests
- Update typescript definition
- Update Bench.js
- Update test.js
- Use geojson-fixtures for inputs
- Normalize folder test/in & test/out
- Add typescript test/types.ts
2017-02-16 11:10:04 -05:00
Denis
ebfcd43b5f Update fixtures for Node 6 #546 2017-01-16 10:33:37 -05:00
Denis
dbded5cf94 Merge pull request #511 from ath0mas/failing-tests
@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).
2017-01-02 23:17:35 -05:00
Denis
269251da2e Fix geojson-normalize namespace 2017-01-02 22:08:14 -05:00
Alexis THOMAS
1d323bd504 Fix hex-grid and buffer tests
Regenerating out fixtures through process.env.REGEN
2016-11-07 23:27:43 +01:00
Tom MacWright
d7e1cc4c03 Fix straggling test dependencies 2016-07-13 11:05:00 -04:00
Tom MacWright
235d916a53 Buffer units (#371)
* Buffer units

* Make buffer tests real

* Improve docs
2016-05-16 15:27:54 -04:00
Tom MacWright
4dcb9a154c Mass simplifications.
* 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
2016-04-23 13:01:24 +05:30
Tom MacWright
9e7d8b02ee Rename turf-extent to turf-bbox 2016-03-18 16:46:59 -04:00
Tom MacWright
55656b92f4 Unirepo: turf in one repository 2016-02-26 17:44:33 -05:00