question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`degreesToDistance` different for Latitude and Longitude

See original GitHub issue

Looking at @turf/helpers distanceToRadians and distanceToDegrees methods I noticed that if you move a point E-W or N-S of the same amount of degrees and calculate the distance between the original point and the moved point, you actually get two different distances. Is that for some reason correct? If so, why? Then, how could you create for example a square from a point' that actually looks like a square? Using @turf/bearing`, due to #681, at 90˚ the end points are not at the same latitude, while varying the coordinates you don’t get a square:

screen shot 2017-04-22 at 12 14 46 am

I added also some test on @turf/helpers to highlight the issue.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
stebogitcommented, Jul 23, 2017

@guanzo if you have just a point you can use @turf/destination

var pt = turf.point([lng, lat]); // note the order
var destinationPoint = turf.destination(pt, 1, yourDirectionAngle, 'miles');
1reaction
DenisCarrierecommented, May 9, 2017

@stebogit I’m 👍 with the method renaming, pretty sure these methods are only used internally. We can include these changes in v5.0 and update the earthRadiusIn factor at the same time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How much distance does a degree, minute, and second cover ...
One-degree of longitude equals 288,200 feet (54.6 miles ), one minute equals 4,800 feet (0.91 mile), and one second equals 80 feet. longitude...
Read more >
How far is a degree of latitude and longitude?
A degree of latitude, one degree north or south, is about the same distance anywhere, about 69 miles (111 kilometers). But a degree...
Read more >
Latitude/Longitude Distance Calculator
Latitude /Longitude Distance Calculator. Enter latitude and longitude of two points, select the desired units: nautical miles (n mi), statute miles (sm), ...
Read more >
Calculating longitude length in miles - GIS Stack Exchange
It doesn't matter at what longitude you are. What matters is what latitude you are. Length of 1 degree of Longitude = cosine...
Read more >
How Big is a Degree? - State Cartographer's Office
To compute the length of one degree of latitude or longitude, ... length of a degree of longitude at different latitudes, based on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found