Mind if I ask if any of you know how to calculate the actual driving distance between two points when latitude and longitude for both starting and destination points as input? Ps: with help of google API.
Related
I am not a geographer or the like, so please excuse if I should know better. But my question is: Is it possible to get the latitude and longitude of certain places from distance data?
More precisely, I have the great-circle distance in kilometers from various places to Berlin. Can I somehow decompose this distance data into latitude and longitude?
(FYI I am an economic historian and I work with the software package Stata.)
Yep, but the answer depends on how accurate you want to be.
Quick and easy, but not exact: just assume the earth is a sphere, treat the lat/lon as spherical coordinates (using a fixed 6373km radius), perform the translation using normal 3D euclidean geometry techniques, and convert back to lat/lon at the end. A good summary of the calculations necessary is here, but in summary:
Oh dear, no Latex on this site! Screenshots from the math subsite is best I could do sorry.
If you already have arc length, then rearrange the equation to solve for your unknown. You'll also need to know the angle of your arc to solve for two unknowns, lat and long.
If you need to be exact, you'll need to take into account the non-spherical Earth. That means the length in meters of a degree latitude depends on the latitude.
As described here:
Work with those equations and perhaps ask another more specific question if you get stuck. This current site is best if you have a programming question and the https://math.stackexchange.com site is best if you have a maths question.
I know this might be silly but excuse me. I have a gps module that I converted the latitude and longitude to xy and I have another point for example: 33.12, 55.12.
What I need it to know is how could I know the difference between the 2 points and if I have the speed of my gps, could I be able to know when I will reach it.
Thank you in advance!
On short distances you can ignore the earth's curvature and go with Pythagorean theorem.
On larger scale you need to remember that earth is a sphere.
Theory and examples with some java here:
http://www.movable-type.co.uk/scripts/latlong.html
I have been researching and trying to figure this one out to no avail. I have found many ways not to solve this...
The gist of the problem: I am looking for a method to calculate the deviance from an original path traveled by way of GPS coordinates. I have multiple csv files that contain latitude, longitude, and UTC time. I have created KML files from this information for a visual viewing of the deviance and now would like to put a value on this deviation. I ahve chosen a route as a reference and would like to measure the other routes against the reference route. There are multiple routes each having it's own reference route, each of which has many runs. No two runs are the same, and some of the routes deviate more than the next. I cannot use time, only lat and lon since the runs were completed over many weeks of data collection.
What I have tried thus far:
Haversine and Equirectangular formulas (looping through and measuring point to point).
Outcome: The coordinates only line up for a short period of time and the difference in the number of points varies greatly.
Area under each curve: was going to find the difference of the two routes by this method.
Outcome: Really unsure how to proceed, nor find equations suitable for this calculation.
There were a couple more feeble attempts, but have been working on this for a few weeks now, with not much to show for and still unsure on how to proceed.
Any help or ideas would be greatly appreciated.
Possible solution 1: Instead of calculating the "sideways" deviation between the two routes, just compare the respective arc lengths (Matlab: arclength).
Possible solution 2: To compare two routes, each going from the same start A to the same end point B: Draw a straight line between A and B, place a number of equidistant points along AB, and then average the perpendicular distance from these points on AB to the paths you want to compare. The absolute difference between the cumulative deviations from the straight-line reference is your deviation.
Possible solution 3: Calculate the arc length of each route. Place a number of equidistant points along each route. Average the distance between these points.
Both solution 2 and 3 will depend on the number of points you place, but with a higher number of points, the average deviation will converge. Note that these solutions are both related to calculating the area under each curve.
I have N number of points (x_N,y_N,z_N) in a point cloud. The point cloud forms the shape of a spherical shaped object. My problem is that I have points in my cloud that stick out noticeably along the z-axis (This is due to pin object inserted in my object during a scan). I would like to remove these points.
One approach I have taken is finding the change in slope for a set of points in my cloud compared to the immediate next set of points. (for example, I take my first 10 points, compute the change in slope and compare it to the change in slope for the next ten points). But this is not working so well. Any suggestions?
Any help would be greatly appreciated. Any confusion towards my problem, just let me know.
If it's sure to be a sphere like object and points are equally spread (no side has more points than other side), take the average X, Y and Z of all points.
This will be next to the center of the sphere. If that pin is not very thick or very long (if it have few points compared to the total), you can assume this as the center.
Then, measure the distance of each point to the center.
Take off those having distances higher than the average distance.
If you know the radii of the sphere and its center, simply calculate the distance of each point to the center and compare to the radii.
I have an observation and a corresponding suggestion:
First, the observation: You appear to be building a custom solution for a one-off case. This will not work when you scan a different object (with the pin sticking out again).
Now, the suggestion: Use something like meshlab, where you can load up a point cloud, select points and delete them.
Of course, if you're ken on writing code to solve this problem, then this is not helpful.
Find the highest point in z, which is 100% sure to be a pin or apart of one.
Set point to be center of sphere and remove all points within chosen radius
Iterate twice more for other pins
I want to create a polygon from a point and a radius.
For example, I want to be able to give a point (latitude, longitude) with a given radius (ex. 10km) and calculate the circle and store it as polygon.
The goal is to be able to query my application with points and ask it if the given point is within a given radius of another point.
Maybe I'm doing it wrong, if there is a simplier way to achieve this I'd be glad to ear about it.
Thanks
I do not see why you need a circle. given two points you can use geopy to calculate distances : http://code.google.com/p/geopy/wiki/GettingStarted#Calculating_distances
an almost identical question: Django model property geo distance