Questions tagged [geo]

geo is the abbreviation for the term "geographic". It includes handling of geographic coordinates and vectors for display and calculation purpose.

1160 questions
277
votes
12 answers

Getting distance between two points based on latitude/longitude

I tried implementing the formula in Finding distances based on Latitude and Longitude. The applet does good for the two points I am testing: Yet my code is not working. from math import sin, cos, sqrt, atan2 R = 6373.0 lat1 = 52.2296756 lon1 =…
gwaramadze
  • 4,523
  • 5
  • 30
  • 42
186
votes
23 answers

Calculate the center point of multiple latitude/longitude coordinate pairs

Given a set of latitude and longitude points, how can I calculate the latitude and longitude of the center point of that set (aka a point that would center a view on all points)? EDIT: Python solution I've used: Convert lat/lon (must be in radians)…
zeke
  • 3,603
  • 2
  • 26
  • 41
178
votes
19 answers

How to convert latitude or longitude to meters?

If I have a latitude or longitude reading in standard NMEA format is there an easy way / formula to convert that reading to meters, which I can then implement in Java (J9)? Edit: Ok seems what I want to do is not possible easily, however what I…
Adam Taylor
  • 7,534
  • 8
  • 44
  • 54
171
votes
6 answers

How to define object in array in Mongoose schema correctly with 2d geo index

I'm currently having problems in creating a schema for the document below. The response from the server always returns the "trk" field values as [Object]. Somehow I have no idea how this should work, as I tried at least all approaches which made…
niels_h
  • 1,869
  • 2
  • 13
  • 15
167
votes
16 answers

Given the lat/long coordinates, how can we find out the city/country?

For example if we have these set of coordinates "latitude": 48.858844300000001, "longitude": 2.2943506, How can we find out the city/country?
meow
  • 27,476
  • 33
  • 116
  • 177
71
votes
2 answers

Formulas to Calculate Geo Proximity

I need to implement a Geo proximity search in my application but I'm very confused regarding the correct formula to use. After some searches in the Web and in StackOverflow I found that the solutions are: Use the Haversine Formula Use the…
Alix Axel
  • 151,645
  • 95
  • 393
  • 500
35
votes
8 answers

Google Maps API 3 fitBounds padding - ensure markers are not obscured by overlaid controls

I'd like to be able add padding to a map view after calling a map.fitBounds(), so all markers can be visible regardless of map controls or things like sliding panels that would cover markers when opened. Leaftlet has an option to add padding to…
jsurf
  • 575
  • 1
  • 8
  • 20
31
votes
9 answers

How to perform bilinear interpolation in Python

I would like to perform blinear interpolation using python. Example gps point for which I want to interpolate height is: B = 54.4786674627 L = 17.0470721369 using four adjacent points with known coordinates and height values: n = [(54.5, 17.041667,…
daikini
  • 1,307
  • 6
  • 23
  • 36
28
votes
1 answer

What is the proper way to use D3's projection.stream()?

So I'm experimenting a bit with D3's geo stream API, and things feel a bit hazy. I've been reading through the documentation here: https://github.com/mbostock/d3/wiki/Geo-Streams One point of confusion I have is the proper implementation of stream…
Al R.
  • 2,430
  • 4
  • 28
  • 40
27
votes
2 answers

Querying within longitude and latitude in MySQL

Before asking for specific code examples, I just wanted to ask whether it is possible to make a query something like this pseudo code: select items from table where lat/lon = -within x miles of a certain lat/lon point- Is that doable? Or do I have…
Genadinik
  • 18,153
  • 63
  • 185
  • 284
27
votes
2 answers

how to plot networks over a map with the least overlap

I have some authors with their city or country of affiliation. I would like to know if it is possible to plot the coauthors' networks (figure 1), on the map, having the coordinates of the countries. Please consider multiple authors from the same…
Ferroao
  • 3,042
  • 28
  • 53
25
votes
7 answers

How to use Redis and geo proximity search to find two users at the same location?

I want to implement a service that, given users' geo coordinates, can detect whether two users are at the very same location in real time. In order to do this in real time and to scale, it seems I should go with a distributed in-memory datastore…
Simian
  • 1,622
  • 3
  • 17
  • 32
22
votes
1 answer

Android GEO Location Tutorial

Does anyone know a good GEO Location tutorial for Android. I don’t want to have to get a Google maps API key I just want an Activity that gets the location of a phone and sticks it in a variable that I can then decide what to do with it…
user903601
22
votes
6 answers

How can i calculate the distance between two gps points in Java?

I used this code but it doesnt work: Need the distance between two gps coordinates like 41.1212, 11.2323 in kilometers (Java) double d2r = (180 / Math.PI); double distance = 0; try{ double dlong = (endpoint.getLon() - startpoint.getLon()) *…
Benni
  • 321
  • 2
  • 3
  • 5
20
votes
2 answers

Android terminal--telnet missing commands, receiving this error : KO: unknown command, try 'help'

I'm trying to set the coordinates on an emulated device. XXXX-MacBook-XXXXX XXXX$ telnet localhost 5554 Trying ::1... telnet: connect to address ::1: Connection refused Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Android…
James
  • 347
  • 4
  • 13
1
2 3
77 78