I have a set of GPS coordinates 12.9611159,77.6362214. What exactly do these mean? How can I convert them to degrees of longitude and latitude? What formula should I use to get accurate distance between two sets of coordinates when the order of distance is 10km.
Most likely 12.9611159 is the latitude in degrees, 77.6362214 the longitude. In that case, the coordinate is in India. If latitude and longitude are reversed, you end up in the Greenland Sea.
You can easily check this by entering the coordinate pair in the Google maps search box. Google expects latitude first.
For the distance, in python you can easily use the haversine package:
from haversine import haversine
my_coord = (12.9611159,77.6362214)
other_coord = (12.9, 77.6)
distance = haversine(my_coord, other_coord)
This will give you the distance in km.
Related
I am using VB.NET and want to calculate the Longitude and Latitude of a point directly EAST of a given point when given a distance of kilometers.
In this example, Point 1 has the longitude of -118.243683 and Latitude of 34.052235. I know that the distance between these two points are exactly 30 kilometers. How do I find the exact Longitude and Latitude of the second point? I know that is is possible to find the distance between two points but I do not know how to find the longitude and latitude of a second point when given a first point and a relative distance (in kilometers) away is 30.
Assuming that the angle is zero degrees between the two points, how do I find the point (in Longitude and Latitude) of the second point?
I have to implement kalman filtering to filter latitude longitude(from a gps sensor) to get precise position information.
i would be getting distance traveled from a wheel sensor and angle from magnetometer or i can also use gps course from gps sensor. I have latitude longitude in degrees or radians and distance in meters.
So before applying the kalman filtering i need to convert this lat/lon to meters, correct?
With this information i think i can predict using the following equation
x=x+dt*xVelocity;
y=y+dt*yVelocity;
I can calculate velocity using the following formula
xVelocity=distance*cos(angle);
yvelocity=distance*sin(angle);
So the problem here is the conversion. i tried to convert the above lat/lon to UTM and then performed the above calculation and just for testing converted it back to lat and lon to give the desired location but the results seemed wrong
For example-
double latitude=24.55662435;
double longitude=55.3525234;
double north,east;
latLonToUTM(latitude,longitude,&north,&east);
int distance=5;//5 meters
int course=200
double xVel=distance*cos(course);
double yVel=distance*sin(course);
north+=yVel;
east+=xVel;
double nxtLat,nxtLon;
UTMtoLatLon(north,east,&nxtLat,&nxtLon);
double distance=calculateDistace2LatLon(latitude,longitude,nxtLat,nxtLon);// Used online tool to get this distance
double bearing=calculateAnglebetween2LatLon(latitude,longitude,nxtLat,nxtLon);//used online tool to get angle also
here the obtained distance is not 5m and angle is 200..
Since this basic test itself is failing i am yet to go to kalman filtering.
First this conversion should be precise to even go further.
Can someone guide me to which method to use to convert this lat/lon to meters to apply velocity to get nxt meter or location?
Also if there is no need to convert then how can we add the distance travelled which is in meters to this lat lon?
How to calculate Altitude from GPS Latitude and Longitude values.What is the exact mathematical equation to solve this problem.
It is possible for a given lat,lon to determine the height of the ground (above sea level, or above Referenz Elipsoid).
But since the earth surface, mountains, etc, do not follow a mathematic formula,
there are Laser scans, performed by Satelites, that measured such a height for e.g every 30 meters.
So there exist files where you can lookup such a height.
This is called a Digital Elevation Modell, or short (DEM)
Read more here: https://en.wikipedia.org/wiki/Digital_elevation_model
Such files are huge, very few application use that approach.
Many just take the altidude value as delivered by the GPS receiver.
You can find some charts with altitude data, like Maptech's. Each pixel has a corresponding lat, long, alt/depth information.
As #AlexWien said these files are huge and most of them must be bought.
If you are interest of using these files I can help you with a C++ code to read them.
You can calculate the geocentric radius, i.e., the radius of the reference Ellipsoid which is used as basis for the GPS altitude. It can be calculated from the the GPS latitude with this formula:
Read more about this at Wikipedia.
Greetings,
I have two coordinates:
(52.4412396, -6.563223)
and
(52.8912397, -6.683669)
The delta is:
(-0.4499999, 0.120446)
The distance moved is:
sqrt((-0.4499999)^2+(0.120446)^2)
=.465840261
How do I convert this to meters?!
I hope someone can help.
Many thanks in advance,
You have mistakenly done the sum of squares on spherical coordinates. Each difference has to be converted to its longitudinal and latitudinal distance before getting the hypotenuse. While latitude converts directly to distance, (each degree is equal to 60 nautical miles) the longitude will only do that at the equator) That means that you have to multiply the above by the cosine of the latitude. Then you can move on to a simple hypotenuse calculation before converting to meters.
as topic, the Coordinates value (Latitude and Longitude) is known , these Coordinates will compose as polygonal area , my question is how to calculate the area of the polygonal that is base the geography ?
thanks for your help .
First you would need to know whether the curvature of the surface would be significant. If it is a relatively small then you can get a good approximation by projecting the coordinates onto a plane.
Determine units of measure per degree of latitude (eg. meters per degree)
Determine units of meature per degree of longitude at a given latitude (the conversion factor varies as you go North or South)
Convert latitude and longitude pairs to (x,y) pairs in the plane
Use an algorithm to compute area of a polygon. See StackOverflow 451425 or Paul Bourke
If you are calculating a large area then spherical techniques must be used.
If I understand your question correctly - triangulation should help you. Basically you break the polygonal to triangles in such a way that they don't overlap and sum their areas.