2024-09-12 22:51:39 +02:00
|
|
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
# ORTHOGRAPHIC
|
|
|
|
# Your personal aerial satellite. Always on. At any altitude.*
|
|
|
|
# Developed by MarStrMind
|
|
|
|
# License: Open Software License 3.0
|
|
|
|
# Up to date version always on marstr.online
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
# og.py
|
|
|
|
# Main file to call to generate an ortho tile; entry point to tool.
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2024-09-24 23:20:36 +02:00
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
from orthographic import *
|
|
|
|
from log import *
|
|
|
|
from defines import *
|
|
|
|
|
|
|
|
|
2024-09-12 22:51:39 +02:00
|
|
|
# Print a welcome message
|
2025-02-01 16:39:15 +01:00
|
|
|
def _welcome():
|
|
|
|
print(r' ')
|
|
|
|
print(r' ____ __ __ __ _ ')
|
|
|
|
print(r' / __ \_____/ /_/ /_ ____ ____ __________ _____ / /_ (_)____')
|
|
|
|
print(r' / / / / ___/ __/ __ \/ __ \/ __ `/ ___/ __ `/ __ \/ __ \/ / ___/')
|
|
|
|
print(r'/ /_/ / / / /_/ / / / /_/ / /_/ / / / /_/ / /_/ / / / / / /__ ')
|
|
|
|
print(r'\____/_/ \__/_/ /_/\____/\__, /_/ \__,_/ .___/_/ /_/_/\___/ ')
|
|
|
|
print(r' /____/ /_/ ')
|
|
|
|
print(r' ----------------------------------------------------------------')
|
|
|
|
print(r' A ground texture generator, using photo realistic resources,')
|
|
|
|
print(r' for flight simulators.')
|
|
|
|
print(r' ----------------------------------------------------------------')
|
|
|
|
print(r' Developed by and (c) Marcus Str.')
|
|
|
|
print(r' Website: https://marstr.online/orthographic')
|
|
|
|
print(r' Code repo: http://marstr.online:3000/marstr/orthographic')
|
|
|
|
print(r' ----------------------------------------------------------------')
|
|
|
|
print(r' If you paid for this software, you have been scammed. The source')
|
|
|
|
print(r' code and always available free of charge.')
|
|
|
|
print(r' ----------------------------------------------------------------')
|
|
|
|
print(r' ')
|
2024-09-12 22:51:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Evaluate CLI arguments and process tile.
|
|
|
|
|
|
|
|
cli = False
|
2024-10-18 21:48:24 +02:00
|
|
|
pbf = False
|
2024-11-12 20:25:46 +01:00
|
|
|
prep = False
|
2024-10-18 21:48:24 +02:00
|
|
|
|
2025-01-26 21:57:50 +01:00
|
|
|
if __name__ == '__main__':
|
2024-10-18 21:48:24 +02:00
|
|
|
|
2025-01-26 21:57:50 +01:00
|
|
|
if len(sys.argv) == 4:
|
|
|
|
cli = True
|
2024-09-12 22:51:39 +02:00
|
|
|
|
2025-01-26 21:57:50 +01:00
|
|
|
# Only if we find enough arguments, proceed.
|
|
|
|
if cli:
|
|
|
|
lat = int(sys.argv[1])
|
|
|
|
lng = int(sys.argv[2])
|
2024-09-12 22:51:39 +02:00
|
|
|
|
2025-01-26 21:57:50 +01:00
|
|
|
mstr_msg("_main", "Beginning tile generation process.")
|
2024-11-16 15:20:00 +01:00
|
|
|
|
2025-01-26 21:57:50 +01:00
|
|
|
# Create the class and init values
|
|
|
|
og = mstr_orthographic(lat, lng, mstr_datafolder, os.getcwd(), prep)
|
2024-11-16 15:20:00 +01:00
|
|
|
|
2025-02-02 12:23:53 +01:00
|
|
|
# Simply generate OSM data
|
|
|
|
if sys.argv[3] == "osm":
|
|
|
|
og._generateData()
|
|
|
|
exit()
|
|
|
|
|
2025-01-26 21:57:50 +01:00
|
|
|
# Generate orthos
|
|
|
|
if sys.argv[3] != "prepare" and sys.argv[3] != "xpscenery":
|
2025-02-01 16:39:15 +01:00
|
|
|
_welcome()
|
2025-01-26 21:57:50 +01:00
|
|
|
og._generateOrthos_mt(int(sys.argv[3]))
|
2025-02-02 12:23:53 +01:00
|
|
|
exit()
|
2024-10-18 21:48:24 +02:00
|
|
|
|
2025-01-26 21:57:50 +01:00
|
|
|
# Build the terrain mesh and assign ground textures
|
|
|
|
if sys.argv[3] == "xpscenery":
|
2025-02-01 16:39:15 +01:00
|
|
|
_welcome()
|
2025-01-26 21:57:50 +01:00
|
|
|
og.generate_xp_scenery()
|
2025-02-02 12:23:53 +01:00
|
|
|
exit()
|
2024-10-18 21:48:24 +02:00
|
|
|
|
|
|
|
|
2025-01-26 21:57:50 +01:00
|
|
|
if cli == False and pbf == False:
|
|
|
|
mstr_msg("_main", "Please provide Latitude and Longitude. Exiting.")
|
|
|
|
print ("")
|
2024-09-12 22:51:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-18 21:48:24 +02:00
|
|
|
# * No Space Shuttle or SpaceShipOne needed to deploy.
|