Questions tagged [earthdistance]

25 questions
1
vote
1 answer

Tree-based algorithm in Scala vs Earth Box

I need to find is point located in a given radius. Now I have a two choices, first is to write my own algorithm for it(or using existing library) second is use postgresql earth_box utility and I can select it directly from db, using stored…
Slow Harry
  • 1,857
  • 3
  • 24
  • 42
0
votes
0 answers

Postgres earthdistance 'function point(text, text) does not exist' error

I am new to Postgres geo queries, I want to find locations within a 10km radius of a particular point so I came across earthdistance. I installed the extension using CREATE EXTENSION earthdistance; After that, I ran my query SELECT *, (point(lng,…
0
votes
1 answer

Postgres zipcode - listings for same mile radius not showing up

Using Postgres and extensions cube and earthdistance I do this query for zipcode 78705 with 50 miles radius range: WITH query1 AS(SELECT * FROM listings WHERE earth_box(ll_to_earth(30.2961708, -97.73895429999999), 80467.2) @>…
dman
  • 10,406
  • 18
  • 102
  • 201
0
votes
1 answer

Postgres, earthdistance - sort results by gps distance

Currently I have a query that selects all the objects closer than X km from specified GPS coordinations: $query = 'SELECT * FROM t_activity WHERE POINT(gps_lat||\',\'||gps_lon) <@> POINT( '.$gps_latitude.', '.$gps_longitude.' …
Axel Stone
  • 1,521
  • 4
  • 23
  • 43
0
votes
0 answers

PostgreSQL -> Groupping by earth_box

Is possible group my entries (contains latitude & longitude values) usgin earth_box to group all by distance (500 meters)!? Thanks ;)
0
votes
1 answer

Fast Approximation if a point on earth is in range

For a game I need to calculate if items on the map are in range of the player. The map is the earth. I'm using the Haversine formula to calculate the distance between the player and each item. However I did some profiling and found out that all…
wertzui
  • 5,148
  • 3
  • 31
  • 51
0
votes
1 answer

Java : Format the distances properly, when compared with location

I am working on a Android application for which the server-side is in Java. When I receive co-ordinates from the user, I am retrieving a list of restaurants, I am calculating the distance from the user, and sorting them in ascending fashion. Right…
We are Borg
  • 5,117
  • 17
  • 102
  • 225
0
votes
1 answer

Performance issue in getting nearest location in realtime app

Currently, I'm working on a project like Uber. It means there are two apps: one for driver and one for customer. The issue is: the driver need to update their location per 2 seconds. And the customer pull all the nearest drivers per 2 seconds for…
Hoa Hoang
  • 1,212
  • 14
  • 20
0
votes
4 answers

How do I write a Java program that calculates the distance between two points on earth?

I know how to start it out and I know how to put in the scanners and everything, but in school, I've never really learned about longitude and latitude formulas and how to convert those points into radians. So I'm pretty much stuck on this Java…
user1029481
  • 291
  • 3
  • 6
  • 12
-1
votes
2 answers

Find the final latitude longitude after a movement on the globe

I am using the Haversine formula to calculate the distance from two latitude-longitude pairs. function getDistanceFromLatLonInKm(lat1,lon1,lat2,lon2) { var R = 6371; // Radius of the earth in km var dLat = deg2rad(lat2-lat1); var dLon =…
Timothy
  • 4,198
  • 6
  • 49
  • 59
1
2