A map generator for random VFR / IFR flight maps. In a nutshell it generates:
- A general wind direction
- Two or more airports, oriented according to the general wind direction
- One or more navigational aids, like VOR or NDB
- Zero or more obstacles like radio towers
- A topographical map
This generator can be used for simple civilian IFR flight simulators without GPS support, like back in the days of Solo Flight. It allows for a random flight adventure:
- Take off at airport 1
- Find your way to airport 2 by calculating your position using NAV 1 (and NAV 2 if present)
- Land at airport 2, possibly with the help of an ILS
The generator takes two parameters:
- A map size in Nautical Miles
- Optional: A seed to generate the map from; identical seeds will generate identical maps
There is also a visible map painting on <Canvas>
.
// Get yourself a randomizer
const randomizer = new Randomizer();
// Build locations
const locations = new LocationsMap(16, randomizer);
// Build terrain around locations
const terrain = new TerrainMap(locations, randomizer, 4);
You may also skip the terrain generation or replace it with any other method for terrain generation, e.g. for a simpler approach to accommodate a more simplistic terrain model.
See https://fboes.github.io/par-avion-map/dist/ to have a whirl with the generator.
The map consists of two layers:
LocationMap
contains points of interest, like airports and navigational beaconsTerrainMap
contains the elevation data
The LocationMap
has multiple entities:
Airport
includingRunway
andWaypoint
Navaid
includingHoldingPattern
Obstruction
Peak
All of these entities use Coordinates
calculated in Nautical Miles from the North-West corner of the map. The TerrainMap
uses TerrainCoordinates
, which are fractions of Nautical Miles from the North-West corner, having a higher resolution for terrain data.
This project ist done in Kalashnikov programming style. The whole project having no set goal and consisting of lots of experiments has a rather ugly code base, hacked together whenever a new idea crosses my mind.
Author: Frank Boës
Copyright & license: See LICENSE.txt