ezod / flipperzero-gps

Flipper Zero application for NMEA 0183 serial GPS modules.
GNU General Public License v3.0
281 stars 26 forks source link

Alternate Coordinate Systems #17

Open sambyte61 opened 1 year ago

sambyte61 commented 1 year ago

Currently, the only coordinate system supported by the app is lat long. The app could also support UTM and MGRS coordinate systems based on the lat long values.

Based on values of GpsUart::status::latitude and GpsUart::status::longitude you could be able to convert them into a UTM coordinate system. And from the UTM zone, northing, and easting, you could convert that into a MGRS grid.

Visualizing the current coordinates in alternative coordinate systems could be achieved by a similar method to how changing the baudrate of the GpsUart is implemented by holding down on the "up" arrow key. By long pressing the "down" arrow key, you could switch between viewing the coordinates in lat long, UTM, and or MGRS.

sambyte61 commented 1 year ago

Here is a demo of this implemented. I have not done UTM to MGRS yet only lat long to UTM.

https://github.com/ezod/flipperzero-gps/assets/37986821/39d0674c-31fa-40c1-b6ae-aaf5cd713fa7

sambyte61 commented 1 year ago

For the conversion of lat long to UTM, I utilized code written by Chuck Gantz which can be found here. It was originally written in cpp, so I converted it to native c.