Skip to main content

fgsmdb — FlightGear Scenemodels Database Tools

Command-line tools for the FlightGear scenemodels database.

Installation

pip install fgsmdb

Or install from source:

cd export-legacy/fgsmdb
pip install .

For development:

pip install -e .

Configuration

Copy .env.example to .env and fill in your values:

cp .env.example .env
Variable Description Default
PGURI PostgreSQL connection URI (required)
FGELEV_PATH Path to the fgelev binary /usr/local/bin/fgelev
FG_ROOT FlightGear data root (needed by fgelev) /app/data
FG_SCENERY Local scenery path (Terrain, Airports, etc.) ./fgscenery
FG_SCENERY_EXPORT Working directory for exported files ./export
GROUNDNETS_PATH Path to groundnets git repository ./groundnets
MIN_UPDATES Minimum pending updates to trigger export 1
SYNC_TARGETS Comma-separated rsync target URIs
CDN_INVALIDATE_CMD Shell command to run after distribution

For remote distribution, rsync uses your ~/.ssh/config for host aliases, usernames, and identity files.

Usage

# Run the export pipeline
python3 -m fgsmdb export

# Or use the installed command
fgsmdb export

Export Command

Exports the scenemodels database to a TerraSync-compatible file tree.

# Full pipeline (all steps except distribute)
python3 -m fgsmdb export

# With a specific .env file
python3 -m fgsmdb export --env-file /path/to/.env

# Run specific steps only
python3 -m fgsmdb export --steps sanitize,export,mkdiridx

# Include distribution to mirrors
python3 -m fgsmdb export --steps sanitize,gndelev,export,mkdiridx,upload,distribute

# Skip the pending-updates threshold check
python3 -m fgsmdb export --skip-check

# Override the minimum updates threshold
python3 -m fgsmdb export --min-updates 10

# Enable verbose (debug) logging
python3 -m fgsmdb export -v

Pipeline Steps

Step Description
sanitize Fix data integrity: update tile numbers, nullify zero elevation offsets
gndelev Compute ground elevation for new objects using fgelev
export Export shared/per-hemisphere models and generate .stg files from the database
mkdiridx Create .dirindex files for TerraSync and the Airports archive
upload Sync exported files to the local scenery tree (hash-based, copies only changes)
distribute Rsync scenery to remote mirror servers (parallel)

By default, all steps except distribute are run. Distribution must be explicitly requested via --steps.

Before any steps execute, the pipeline calls fn_update_statistics() and checks whether the number of objects pending ground elevation meets the configured threshold. Use --skip-check to bypass this gate.

Command Line Options

python3 -m fgsmdb export [-h] [--env-file ENV_FILE] [--steps STEPS] [--all]
                         [--skip-check] [--min-updates N] [-v]

Options:
  --env-file ENV_FILE   Path to .env file (default: auto-detect)
  --steps STEPS         Comma-separated steps: sanitize, gndelev, export,
                        mkdiridx, upload, distribute
  --all                 Run all steps (same as default, without distribute)
  --skip-check          Skip the pending-updates threshold check
  --min-updates N       Override the MIN_UPDATES threshold from .env
  -v, --verbose         Enable debug logging
  -h, --help            Show help message

Output Structure

fgscenery/
├── .dirindex
├── Airports_archive.tgz
├── SharedModels.txz
├── Airports/
│   ├── .dirindex
│   └── ...
├── Models/
│   ├── .dirindex
│   └── <group_path>/
├── Objects/
│   ├── .dirindex
│   └── <e|w>NNN<n|s>NN/
│       └── <e|w>NNN<n|s>NN/
│           ├── <tile>.stg
│           └── <model_files>
└── Terrain/
    └── .dirindex

License

GNU General Public License v2.0 — see LICENCE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fgsmdb-0.1.0.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fgsmdb-0.1.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file fgsmdb-0.1.0.tar.gz.

File metadata

  • Download URL: fgsmdb-0.1.0.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for fgsmdb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e535302b6793af0ead5ca9470869349eeddb5e4a8901e04d02c5e9737acfffed
MD5 d068f5d9fb8301ddc58a2e1e0ce4c6bb
BLAKE2b-256 3b13649298543260de5886101d4691deed7ec917a3381a969fcc06145ae64cc6

See more details on using hashes here.

Provenance

The following attestation bundles were made for fgsmdb-0.1.0.tar.gz:

Publisher: publish-fgsmdb.yml on t3r/smweb-vue

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fgsmdb-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fgsmdb-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for fgsmdb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93425e38dd5f4f28afafaea02ed725fe66a4f0368324dd44fd031f6718e4719d
MD5 821c0b0b4393f7d0ecdbf74c67aad59f
BLAKE2b-256 6ccd032a85e8062e454c1a2f40f2bdcaf1edae79f9500d4bd74b6d70cdefcf2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for fgsmdb-0.1.0-py3-none-any.whl:

Publisher: publish-fgsmdb.yml on t3r/smweb-vue

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page