How to convert hex data to decimal degree latitude and longitude? - gps

I have been trying to decode GPS coordinates (latitude and longitude) which is in HEX format, and the documentation doesn't have a clear explanation, please help me out. I'm adding some examples below.
latitude 0x414F51 = +28.758963 dd(decimal degree)
longitude 0x45429B = +077.627784dd(decimal degree)
screenshot of the documentation
official documentation

Related

convert RD coordinates to decimal degrees

I want to convert Dutch RD coordinates to longitude and latitude decimal degree coordinates. Example:
108519 438598
108518 438578
108517 438578
to
51.93391 4.71134
51.93382 4.71133
51.93373 4.71131
Which packages and what code can I use to apply this on a bigger dataset?
For coordinate conversion one usually uses the proj.4 lib.
Its available for many programming languages, like python, java, c
First you need to find out the projection number as EPSG number.
e.g https://epsg.io/28992
On that page under "export" there is a section for the proj.4 definition of that projection, which gives this string:
"+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs"
Using the proj4 lib, you can then convert to WGS84 latitude and longitude, this is the format you want.

8-9 digits latitude/longitude format

i have a database of latitude and longitude GPS coordinates in this format:
Latidude Longitude
20908403.7226004675030708 223749828.7524890005588531
20908403.7325199767947197 223749828.7432585060596466
20908403.2405762746930122 223749828.7983648478984833
I tried to do a 1/10^6 rescaling and the trajectory i obtained is the expected one, but i'm struggling too understand the format of the coordinates and their physical meaning.
In my opinion those cannot be:
decimal degrees: 52.145339, 5.331997;
NE coordinates: 52°08'43.2"N 5°19'55.2"E;
Some kind of ECEF-like coordinates;
and i'm out of options.
Thank you in advance for your help,
greetings.
Alessandro
Update:
The format was a "proprietary" one by the company we were working for.
Probably, this format is to "increase" the accuracy with more decimal digits. But, it is important to know the following:
be careful with the number of digits

Kalman filtering - latitude longitude needs to be converted to meters?

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?

What a set of GPS coordinates means?

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.

How to calculate Altitude using GPS latitude and longitude

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.