orthographic/og.py

90 lines
3.1 KiB
Python

# -------------------------------------------------------------------
# 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.
# -------------------------------------------------------------------
import sys
import os
from orthographic import *
from log import *
from defines import *
# Print a welcome message
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' ')
# Evaluate CLI arguments and process tile.
cli = False
pbf = False
prep = False
if __name__ == '__main__':
if len(sys.argv) == 4:
cli = True
# Only if we find enough arguments, proceed.
if cli:
lat = int(sys.argv[1])
lng = int(sys.argv[2])
mstr_msg("_main", "Beginning tile generation process.")
# Create the class and init values
og = mstr_orthographic(lat, lng, mstr_datafolder, os.getcwd(), prep)
# Simply generate OSM data
if sys.argv[3] == "osm":
og._generateData()
exit()
# Generate orthos
if sys.argv[3] != "prepare" and sys.argv[3] != "xpscenery":
_welcome()
og._generateOrthos_mt(int(sys.argv[3]))
exit()
# Build the terrain mesh and assign ground textures
if sys.argv[3] == "xpscenery":
_welcome()
og.generate_xp_scenery()
exit()
if cli == False and pbf == False:
mstr_msg("_main", "Please provide Latitude and Longitude. Exiting.")
print ("")
# * No Space Shuttle or SpaceShipOne needed to deploy.