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

Add WGS84 to @turf/helpers #980

Merged
merged 1 commit into from
Sep 27, 2017
Merged

Add WGS84 to @turf/helpers #980

merged 1 commit into from
Sep 27, 2017

Conversation

DenisCarriere
Copy link
Member

Add WGS84 to @turf/helpers

Pulled from @tmcw's https://github.com/mapbox/wgs84

Built-in variables for WGS84 related things.

Ref: #978

How to use

import { wgs84 } from '@turf/helpers';

wgs84.RADIUS // => 6378137

CC: @stebogit

@DenisCarriere DenisCarriere added this to the 5.0.0 milestone Sep 27, 2017
@DenisCarriere DenisCarriere self-assigned this Sep 27, 2017
@DenisCarriere
Copy link
Member Author

DenisCarriere commented Sep 27, 2017

@stebogit Weird errors like this happen... 🤔

https://travis-ci.org/Turfjs/turf/builds/280554132#L1495

lerna ERR! execute     if (mutate !== true) geojson = clone(geojson);
lerna ERR! execute                                    ^
lerna ERR! execute 
lerna ERR! execute TypeError: clone is not a function

I think these errors are caused by export default function() when the modules don't have a name and for some reason it can't find external functions 🤔

https://github.com/Turfjs/turf/blob/master/packages/turf-clone/index.js#L13

Going to merge this since 1/2 of the tests passed.

@DenisCarriere DenisCarriere merged commit adac319 into master Sep 27, 2017
@stebogit
Copy link
Collaborator

@DenisCarriere the earth radius is not what here was agreed upon.
In my understanding it should be 6371008.8 meters.

@DenisCarriere
Copy link
Member Author

Yep, I changed it to the value you provided, the earth radius value we need is for the Haversine area/distance calculations.

@DenisCarriere
Copy link
Member Author

earthRadius => 6371008.8

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