Skip to content
This repository has been archived by the owner on Aug 14, 2018. It is now read-only.

Question #2

Open
jcguarinpenaranda opened this issue Oct 26, 2017 · 2 comments
Open

Question #2

jcguarinpenaranda opened this issue Oct 26, 2017 · 2 comments

Comments

@jcguarinpenaranda
Copy link

Why is max distance 200km? How could I make this calculation for more than that?

@juliuste
Copy link
Owner

juliuste commented Oct 26, 2017

This lib does not consider that the earth is a sphere, I should deprecate it. You should use @turf/center instead:

npm i --save @turf/turf
const turf = require('@turf/turf')

const point1 = [-97.522259, 35.4691]
const point2 = [10.502754, 31.463455]
const point3 = [45.502754, -24.463455]

const center = turf.center(turf.featureCollection([
	turf.point(point1),
	turf.point(point2),
	turf.point(point3)
	// even more points
])

Hope this helps, feel free to ask again if something's unclear 🙂

@derhuerst
Copy link

derhuerst commented Nov 24, 2017

What I like about geographic-centre is a) the straightforward name and b) the ease of use.

@juliuste What do you think about adapting geographic-center to used @turf/center under the hood? It could do generate the FeatureCollection and Points and pass them on?

Or is there a fasts and/or more direct implementation that accepts bare latitude/longitude pairs?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants