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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e535302b6793af0ead5ca9470869349eeddb5e4a8901e04d02c5e9737acfffed
|
|
| MD5 |
d068f5d9fb8301ddc58a2e1e0ce4c6bb
|
|
| BLAKE2b-256 |
3b13649298543260de5886101d4691deed7ec917a3381a969fcc06145ae64cc6
|
Provenance
The following attestation bundles were made for fgsmdb-0.1.0.tar.gz:
Publisher:
publish-fgsmdb.yml on t3r/smweb-vue
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fgsmdb-0.1.0.tar.gz -
Subject digest:
e535302b6793af0ead5ca9470869349eeddb5e4a8901e04d02c5e9737acfffed - Sigstore transparency entry: 2252317457
- Sigstore integration time:
-
Permalink:
t3r/smweb-vue@64affef811035adf5e159f0800929cd3e993d7b5 -
Branch / Tag:
refs/tags/fgsmdb-v0.1.0 - Owner: https://github.com/t3r
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-fgsmdb.yml@64affef811035adf5e159f0800929cd3e993d7b5 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93425e38dd5f4f28afafaea02ed725fe66a4f0368324dd44fd031f6718e4719d
|
|
| MD5 |
821c0b0b4393f7d0ecdbf74c67aad59f
|
|
| BLAKE2b-256 |
6ccd032a85e8062e454c1a2f40f2bdcaf1edae79f9500d4bd74b6d70cdefcf2c
|
Provenance
The following attestation bundles were made for fgsmdb-0.1.0-py3-none-any.whl:
Publisher:
publish-fgsmdb.yml on t3r/smweb-vue
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fgsmdb-0.1.0-py3-none-any.whl -
Subject digest:
93425e38dd5f4f28afafaea02ed725fe66a4f0368324dd44fd031f6718e4719d - Sigstore transparency entry: 2252317900
- Sigstore integration time:
-
Permalink:
t3r/smweb-vue@64affef811035adf5e159f0800929cd3e993d7b5 -
Branch / Tag:
refs/tags/fgsmdb-v0.1.0 - Owner: https://github.com/t3r
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-fgsmdb.yml@64affef811035adf5e159f0800929cd3e993d7b5 -
Trigger Event:
push
-
Statement type: