Questions tagged [geographic-distance]

Geographical distance is the distance measured along the surface of the earth.

Geographical distance is the distance measured along the surface of the earth.

77 questions
0
votes
2 answers

Get lat lon for a pos when only dx dy is known from an other point

The problem I have is getting the latitude and longitude for a position when I know one origin position and the offset to the other point (in meter) I want to use following function (or any other function that gives me a correct lat2 and…
axel_ande
  • 359
  • 1
  • 4
  • 20
0
votes
1 answer

STDistance – Calculates distance between two objects

I try to calculate the distance between two objects. declare @p1 geography declare @p2 geography SELECT @p1 = WKT from tbl_1 where loc = "school" SELECT @p2 = WKT from tbl_2 where loc = "school" select round(@p1.STDistance(@p2)/1000,0)…
John Doe
  • 9,843
  • 13
  • 42
  • 73
0
votes
2 answers

Restructuring data for geographic proximity analyses in R

I have a data set of people's geographic coordinates, which looks like this: Person Latitude Longitude 1 46.0614 -23.9386 2 48.1792 63.1136 3 59.9289 66.3883 4 42.8167 58.3167 5 43.1167 …
waxattax
  • 357
  • 2
  • 12
0
votes
1 answer

Plot geographic coordinates alongside with multidimensional scaling coordinates in R

The problem described deals with representing multidimensional scaling (MDS) coordinates alongside with real data points (longitude and latitute of cities). So, I have a distance matrix, which is uploaded here. The entries in the matrix represent…
Andrej
  • 3,719
  • 11
  • 44
  • 73
0
votes
1 answer

Latitude saving as -90 With PostGIS RGeo Lat/Lng Points

I am working with Geo Spatial coordinates and was testing my coding in rails console Looks like it is changing my longitude to -90.0 instead of what it should be -93.291557312011719 Any help would be appreciated.. tried it with just…
Big Al Ruby Newbie
  • 834
  • 1
  • 10
  • 30
0
votes
1 answer

How can I select points in SQL Server 2012 based on geography if they are text fields

Okay I'm kind of stuck with this database, and I'm trying to make a "nearby" page for it. What I have (unfortunately) is a lat and a lon column that are nvarchar. I can't convert them because they're needed elsewhere as text. I would like to take…
0
votes
1 answer

ORDER BY clause to sort by proximity

So, I'm working on a search form for my site. I've run into a road block. Seems others have too but I've been unable to find an answer for my question, at least one that I understand. I found a PHP function online that grabs up all the zip codes…
jared10222
  • 25
  • 6
0
votes
1 answer

How to assign several names to lat-lon observations

I have two dataframes: df1 contains observations with lat-lon coordinates; df2 has names with lat-lon coordinates. I want to create a new variable df1$names which has for each observation the names of df2 that are within a specified distance to that…
Jaap
  • 81,064
  • 34
  • 182
  • 193
0
votes
1 answer

How to assign a name to lat-long observations based on shortest distance

I have two dataframes: df1 contains observations with lat-lon coordinates; df2 has names with lat-lon coordinates. I want to create a new variable df1$name which has for each observation the name of df2 that has the shortest distance to that…
Jaap
  • 81,064
  • 34
  • 182
  • 193
0
votes
1 answer

What coordinate system is used in the spherical law of cosines?

spherical law of cosines is the formula used to calculate the distance between two points on the earth. I've been looking for a reference that discuss about the coordinate system is used in that formula, but no one has discussed what the coordinates…
0
votes
1 answer

Efficiently finding the distance between 2 lat/longs in SQL

I'm working with billions of rows of data, and each row has an associated start latitude/longitude, and end latitude/longitude. I need to calculate the distance between each start/end point - but it is taking an extremely long time. I really need to…
0
votes
2 answers

DBGrid - how to show the differnce between a column value in two adjacent rows as another column?

Let's say I record my car's latitude & longitude every minute or so, adding a row to a table each time. I want to have a DB grid with 4 columns latitude longitude distance since last measurment curent street address, if known Number 4, I can try…
Mawg says reinstate Monica
  • 38,334
  • 103
  • 306
  • 551
0
votes
1 answer

Getting incorrect latitude and longitudes for large distances

I am using the following function. private static Location CoordinateAtADistance(double latOrigin, double lonOrigin, double radius, double angle) { double lonDestination; double R = 6371.0; double d = radius / R; //…
Rajat Saini
  • 557
  • 7
  • 26
0
votes
1 answer

Bug in SQL Server geography?

Can someone please confirm if this is a bug or I'm doing something wrong please? I've this stored procedure (SQL Server 2008) ALTER PROCEDURE [dbo].[Distance] @origin varchar(50),@destination varchar(50),@unit varchar(5) as declare @or geography,…
polonskyg
  • 4,269
  • 9
  • 41
  • 93
-1
votes
1 answer

How to calculate the geographic and language distance between all countries and the USA in R

I am trying to measure the geographic and language distance between all countries and the United States (e.g. the distance between Canada and the USA, Iran and USA, and etc). The data is available via…
SaraFormula
  • 61
  • 1
  • 6