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

Improved/fixed @turf/buffer using equidistant buffers #718

Merged
merged 2 commits into from
May 8, 2017

Conversation

DenisCarriere
Copy link
Member

Issue

Buffers were being distorted the further away it was from [0, 0]. Distances from north to south were different than west to east when measuring the output buffer. The expected output of a buffer should have its geometry equidistance in all directions.

Summary

  • Project coordinates using TransverseMercator centered/rotated on GeoJSON before applying jsts buffer calculation, unproject coordinates (to degrees) for final output.
  • Added a few more input validation
  • Dropped @turf/dissolve since jsts was faster with multiPoint
  • Added Geometry Object tests
  • Added prevent input mutation tests
  • Used @w8r's moscow-rings as inspiration.

Ref: #660 #88
CC: @flightsurvey @bjornharrtell @rowanwins

Before

MultiPoint in high latitudes were heavily distorted

image

After

Buffer is now equi-distance (50 miles in all directions)

image

Equidistance Polygon Buffer

image

image

- 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
Is fixed in next minor release
@rowanwins
Copy link
Member

Looks like a big improvement @DenisCarriere , nice one!

@DenisCarriere DenisCarriere merged commit 1002a7b into master May 8, 2017
@DenisCarriere DenisCarriere deleted the buffer-equidistance branch May 8, 2017 04:04
@DenisCarriere DenisCarriere mentioned this pull request May 17, 2017
8 tasks
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