### Bookstore

 Computer Math and Games in Pascal (preview) Lazarus Handbook

### Author Topic: working with GPS coordinates  (Read 621 times)

#### mika

• New Member
• Posts: 29
##### working with GPS coordinates
« on: January 27, 2021, 08:12:14 pm »
Looking for package/unit written in pascal that work with GPS coordinates. I need function - distance and angle between two GPS coordinates.

#### wp

• Hero Member
• Posts: 8288
##### Re: working with GPS coordinates
« Reply #1 on: January 27, 2021, 09:59:08 pm »
GPS distance is implemented in unit mvEngine of the LazMapViewer package (install via OPM, or look directly at https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/lazmapviewer/).

What is the "angle" between two GPS points?
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

#### mika

• New Member
• Posts: 29
##### Re: working with GPS coordinates
« Reply #2 on: January 27, 2021, 10:45:27 pm »
What is the "angle" between two GPS points?
« Last Edit: January 27, 2021, 10:56:02 pm by mika »

#### MarkMLl

• Hero Member
• Posts: 2405
##### Re: working with GPS coordinates
« Reply #3 on: January 27, 2021, 10:56:55 pm »
He means "are you talking about a course, a heading, a bearing, the great circle angle, the angle subtended from the POV of one (unspecified) satellite..."

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

#### wp

• Hero Member
• Posts: 8288
##### Re: working with GPS coordinates
« Reply #4 on: January 27, 2021, 11:27:27 pm »
Of course. This is an intermediate result of the CalcGeoDistance function that I menationed, before the angle is multiplied by the earth radius.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

#### mika

• New Member
• Posts: 29
##### Re: working with GPS coordinates
« Reply #5 on: January 28, 2021, 11:02:09 am »
This is an intermediate result of the CalcGeoDistance function that I menationed, before the angle is multiplied by the earth radius.
Sadly i could not extract "azimuth" from function CalcGeoDistance.
I found this and translated to pascal:
https://www.movable-type.co.uk/scripts/latlong-vincenty.html
It would be nice if there would be fcl-gps or gps package in fpc.

#### sstvmaster

• Full Member
• Posts: 241
##### Re: working with GPS coordinates
« Reply #6 on: January 28, 2021, 11:50:55 am »
Here i have written an example some time ago, see attachment.
Windows 10 (64 bit)
Lazarus: 2.0.12 / Trunk x32

#### mika

• New Member
• Posts: 29
##### Re: working with GPS coordinates
« Reply #7 on: January 28, 2021, 02:15:35 pm »
Here i have written an example some time ago, see attachment.
Thank you. It's what I was looking for.