stronnag / mwptools

ground station, mission planner and tools for inav and multiwii-nav
http://stronnag.github.io/mwptools/
GNU General Public License v3.0
190 stars 35 forks source link

[Feature Request] Support local DEMs for Terrain and Line of sight #158

Closed stronnag closed 7 months ago

stronnag commented 7 months ago

Requirement

It would be nice if mwp could use local DEMs in order to speed up terrain / LOS analysis and remove the requirement for a user BING API key.

Advantages

Disadvantages

Proposed Solution

Example speedup

Experiment with locally hosted (file system) MapZen DEM (*.hgt) files v BING Rest API.

Local DEM

2023/11/12 20:38:41 Local elev 46 took 157.676µs
2023/11/12 20:38:41 Local elev 593 took 1.853239ms

Bing DEM

2023/11/12 20:38:06 Bing elev 46 took 238.73595ms
2023/11/12 20:38:08 Bing elev 593 took 2.211965854s

i.e. local DEM is about 100 times faster. Note, I have a somewhat slow rural internet, even so, the speed up is nice.

Storage requirement

Local storage is quite small for most users. DEM files cover 1° x 1°, so a single file may suffice for most users. Each file is 25MB, for example:

-rw-r--r-- 1 jrh jrh 25934402 Nov 12 13:48 N37W123.hgt
-rw-r--r-- 1 jrh jrh 25934402 Nov 13 13:40 N51E007.hgt
-rw-r--r-- 1 jrh jrh 25934402 Nov 13 21:05 N54W005.hgt
-rw-r--r-- 1 jrh jrh 25934402 Nov 14 13:28 S39E175.hgt

Testing Opportunity

stronnag commented 7 months ago

Using local DEMs is now the default. The DEMs are stored in ~/.cache/mwp/DEMs/ which is created on demand.

stronnag commented 7 months ago

In dev branch.