orthographic/defines.py

437 lines
15 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
# -------------------------------------------------------------------
# defines.py
# Variables we need in all functions. Each one is documented below.
# -------------------------------------------------------------------
# Your data folder - meaning where the cache is stored, and where the finished
# tiles will go. This is also the folder where the image generation sources are
# stored.
#mstr_datafolder = "M:/Developer/Projects/orthographic/"
mstr_datafolder = "/home/marcus/Data/Developer/Projects/orthographic/"
# Switched to Linux, so path is amended
# API endpoint to acquire OSM data (bonus: I have my own)
mstr_osm_endpoint = "https://marstr.online/osm/v1/"
# Define the texture resolution you want to have your photos at.
mstr_photores = 2048
# Radius of zoom level 18 aerials around airports with ICAO code
# Value is in tiles - not in km
#
# Value = 5:
# #####
# #####
# ##X##
# #####
# #####
#
# The "X" is the tile with the airport
mstr_airport_radius = 5
# Clear cache after generating a complete tile?
mstr_clear_cache = True
# Removes the masks etc after a tile has been generated. Strong recommendation to set this
# to True.
# Whether or not you want to see progress of the tool as it walks on.
# High recommendation to leave this on.
mstr_show_log = True
# Should a pseudo shadow be rendered on certain elements?
# The sun is usually somewhere when a photo is taken during the day. Therefore,
# some kind of shadow is cast in a direction, but this depends on a lot of factors.
# We will simply things to achieve good-looking results.
# You can, however, disable the shadow rendering layer here.
mstr_shadow_enabled = True
mstr_shadow_strength = 0.65
mstr_shadow_shift = 16
mstr_shadow_floor_h = 2.8 # 2.5m ceiling height + 30cm concrete per floor
# The tags that cast shadows
mstr_shadow_casters = [
("landuse", "forest"),
("leisure", "nature_reserve"),
("natural", "wood")
]
# Whether or not to generate X-Plane Scenery files
mstr_xp_genscenery = True
# Generate normal maps for X-Plane scenery?
# Strong recommendation: yes
mstr_xp_scn_normalmaps = True
# Paths to required X-Plane scenery tools
mstr_xp_meshtool = "/home/marcus/Developer/Projects/orthographic/bin/MeshTool"
mstr_xp_ddstool = "/home/marcus/Developer/Projects/orthographic/bin/DDSTool"
mstr_xp_dsftool = "/home/marcus/Developer/Projects/orthographic/bin/DSFTool"
mstr_xp_xessrc = "https://dev.x-plane.com/update/misc/MeshTool/"
mstr_xp_floor_height = 2.8 # 2.5m ceiling height + 30cm concrete per floor
mstr_xp_ortho_location = "/home/marcus/Data/Sim/Simulator/orthographic/"
# If you set the above to true, you can define for which features you
# want to generate normal maps for. The below is my recommendation for
# good-looking orthos in the simulator.
mstr_xp_normal_maps = [
("landuse", "farmland"),
("landuse", "meadow"),
("landuse", "orchard"),
("landuse", "forest"),
("natural", "wetland"),
("natural", "bare_rock"),
("natural", "scrub"),
("natural", "heath"),
("natural", "sand"),
("natural", "desert"),
("leisure", "nature_reserve"),
("building", "*")
]
# How much of a tile we need for each zoom level. The higher
# the zoom level, the smaller the area to generate a mask of - but also
# higher detail.
mstr_zl_16 = 0.08
mstr_zl_17 = 0.048
mstr_zl_18 = 0.016
mstr_zl_19 = 0.008
# The layers we will process, from bottom to top.
# Tag, and value.
# Strong recommendation NOT to alter this list -
# generating the orthos depends on the pool of source
# material I provide for these layers. If you add your own
# OSM tag, and there is no source material, the script will
# most likely crash.
mstr_ortho_layers = [
# Z-Order 0
#("boundary", "administrative", "admin_level", ["8", "9", "10", "12"], "landuse", "residential-boundary"),
# Z-Order 1
("landuse", "residential", "landuse", "residential-boundary"),
("landuse", "grass", "landuse", "grass"),
("landuse", "cemetery", "landuse", "grass"),
("landuse", "recreation_ground", "landuse", "meadow"),
("leisure", "golf_course", "leisure", "golf_course"),
("landuse", "greenfield", "landuse", "grass"),
("landuse", "orchard", "landuse", "meadow"),
("landuse", "meadow", "landuse", "meadow"),
("landuse", "construction", "landuse", "construction"),
("natural", "grassland", "landuse", "meadow"),
("barrier", "hedge", "natural", "heath"),
("landuse", "vineyard", "landuse", "meadow"),
("natural", "bare_rock", "natural", "bare_rock"),
("highway", "track", 3),
("highway", "path", 3),
("leisure", "park", "leisure", "green"),
("leisure", "dog_park", "leisure", "green"),
("leisure", "garden", "leisure", "green"),
("leisure", "sports_centre", "leisure", "green"),
("leisure", "pitch", "leisure", "green"),
("leisure", "playground", "leisure", "green"),
("landuse", "farmland", "landuse", "farmland"),
("landuse", "farmyard", "landuse", "farmland"),
("landuse", "military", "landuse", "residential-boundary"),
# Z-Order 2
("highway", "service", 6),
("highway", "residential", 12),
("highway", "footway", 4),
("highway", "primary", 25),
("highway", "secondary", 13),
("highway", "tertiary", 20),
("highway", "unclassified", 17),
("highway", "living_street", 12),
("waterway", "stream", 2),
("amenity", "parking", "amenity", "parking"),
("amenity", "school", "amenity", "school"),
("leisure", "nature_reserve", "landuse", "forest"),
("landuse", "forest", "landuse", "forest"),
("natural", "wood", "natural", "wood"),
("natural", "tree_row", 22),
("natural", "wetland", "natural", "wetland"),
("natural", "scrub", "natural", "scrub"),
("natural", "heath", "natural", "heath"),
("natural", "sand", "natural", "sand"),
("natural", "desert", "natural", "desert"),
# Z-Order 3
("natural", "bay", "natural", "beach"),
("natural", "beach", "natural", "beach"),
("leisure", "swimming_pool", "natural", "water"),
("highway", "pedestrian", 4),
# Z-Order 4
("highway", "motorway", 32),
("railway", "rail", 5),
# Z-Order 5
("aeroway", "taxiway", 42),
("aeroway", "runway", 80),
("building", "detached", "building", "common"),
("building", "church", "building", "common"),
("building", "hotel", "building", "industrial"),
("building", "farm", "building", "industrial"),
("building", "semidetached_house", "building", "common"),
("building", "apartments", "building", "common"),
("building", "civic", "building", "common"),
("building", "garage", "building", "industrial"),
("building", "office", "building", "office"),
("building", "retail", "building", "industrial"),
("building", "industrial", "building", "industrial"),
("building", "house", "building", "house"),
("building", "terrace", "building", "industrial"),
("building", "hangar", "building", "industrial"),
("building", "school", "building", "common"),
("building", "kindergarten", "building", "kindergarten"),
("building", "public", "building", "public"),
("building", "commercial", "building", "commercial"),
("building", "yes", "building", "common"),
("water", "lake", "natural", "water"),
("water", "pond", "natural", "water"),
("water", "river", "natural", "water"),
("natural", "water", "natural", "water"),
("waterway", "river", 10),
("place", "sea", "natural", "sea"),
("place", "ocean", "natural", "sea")
]
# Blur values for the single masks of the ortho layers
mstr_mask_blur = [
# Z-Order 0
("landuse", "residential", 20),
("boundary", "administrative", 20),
# Z-Order 1
("landuse", "grass", 12),
("landuse", "cemetery", 12),
("landuse", "greenfield", 12),
("landuse", "orchard", 12),
("landuse", "meadow", 12),
("landuse", "construction", 5),
("barrier", "hedge", 1),
("landuse", "recreation_ground", 20),
("landuse", "vineyard", 12),
("natural", "grassland", 12),
("natural", "wetland", 30),
("natural", "scrub", 15),
("natural", "heath", 15),
("leisure", "park", 15),
("leisure", "golf_course", 25),
("leisure", "dog_park", 15),
("leisure", "garden", 20),
("leisure", "sports_centre", 5),
("leisure", "pitch", 2),
("leisure", "playground", 2),
("landuse", "farmland", 10),
("landuse", "farmyard", 10),
# Z-Order 2
("landuse", "forest", 10),
("leisure", "nature_reserve", 10),
("natural", "wood", 10),
("natural", "tree_row", 10),
("landuse", "military", 15),
# Z-Order 3
("natural", "bare_rock", 25),
("natural", "water", 4),
("natural", "bay", 30),
("natural", "beach", 30),
("water", "lake", 10),
("water", "pond", 10),
("water", "river", 10),
("leisure", "swimming_pool", 10),
("waterway", "river", 10),
("waterway", "stream", 4),
("amenity", "parking", 1),
("amenity", "school", 1),
("highway", "pedestrian", 12),
# Z-Order 4
("highway", "motorway", 1),
("highway", "primary", 1),
("highway", "secondary", 1),
("highway", "tertiary", 1),
("highway", "unclassified", 1),
("highway", "living_street", 1),
("highway", "residential", 1),
("highway", "service", 1),
("highway", "footway", 2),
("highway", "track", 2),
("highway", "path", 2),
("railway", "rail", 2),
# Z-Order 5
("aeroway", "taxiway", 2),
("aeroway", "runway", 2),
("building", "detached", 1),
("building", "church", 1),
("building", "hotel", 1),
("building", "farm", 1),
("building", "semidetached_house", 1),
("building", "apartments", 1),
("building", "civic", 1),
("building", "garage", 1),
("building", "office", 1),
("building", "retail", 1),
("building", "industrial", 1),
("building", "house", 1),
("building", "terrace", 1),
("building", "hangar", 1),
("building", "school", 1),
("building", "kindergarten", 1),
("building", "public", 1),
("building", "commercial", 1),
("building", "yes", 0),
("place", "sea", 1),
("place", "ocean", 1)
]
# Base colors for different building types
mstr_building_base_colors = [
("detached", [
"#693333", "#592b2b", "#513434", "#4a1e1e", "#362626",
"#534136", "#4d3424", "#534b45", "#553724", "#574c45",
"#373942", "#40424a", "#363b4f", "#2c2d32", "#444651",
"#454545", "#39393b", "#4b4b4c", "#363638", "#525252"
]
),
("church", [
"#373942", "#40424a", "#363b4f", "#2c2d32", "#444651",
"#454545", "#39393b", "#4b4b4c", "#363638", "#525252"
]
),
("hotel", [
"#373942", "#40424a", "#363b4f", "#2c2d32", "#444651",
"#454545", "#39393b", "#4b4b4c", "#363638", "#525252"
]
),
("farm", [
"#693333", "#592b2b", "#513434", "#4a1e1e", "#362626",
"#534136", "#4d3424", "#534b45", "#553724", "#574c45"
]
),
("semidetached_house", [
"#693333", "#592b2b", "#513434", "#4a1e1e", "#362626",
"#534136", "#4d3424", "#534b45", "#553724", "#574c45",
"#373942", "#40424a", "#363b4f", "#2c2d32", "#444651",
"#454545", "#39393b", "#4b4b4c", "#363638", "#525252"
]
),
("apartments", [
"#373942", "#40424a", "#363b4f", "#2c2d32", "#444651",
"#454545", "#39393b", "#4b4b4c", "#363638", "#525252"
]
),
("civic", [
"#7b848b", "#5d6d7b", "#5e646a", "#454d53", "#585b5e",
"#877a78", "#797372", "#797372", "#6f5550", "#7c7574"
]
),
("garage", [
"#693333", "#592b2b", "#513434", "#4a1e1e", "#362626",
"#523731", "#46484e", "#33353a", "#3a3733", "#5d5a57"
]
),
("office", [
"#403a33", "#4f4b46", "#413629", "#574c3f", "#3a2e21",
"#aaaeb6", "#939cac", "#8a919d", "#a0b9bf", "#8d999b",
"#49575a", "#273d43", "#313a3c", "#484f50", "#212d30"
]
),
("retail", [
"#403a33", "#4f4b46", "#413629", "#574c3f", "#3a2e21",
"#aaaeb6", "#939cac", "#8a919d", "#a0b9bf", "#8d999b",
"#49575a", "#273d43", "#313a3c", "#484f50", "#212d30"
]
),
("industrial", [
"#939fa2", "#728080", "#9eafaf", "#4f6061", "#96b2b6",
"#b2b398", "#878868", "#989888", "#bdb79c", "#959386"
]
),
("house", [
"#693333", "#592b2b", "#513434", "#4a1e1e", "#362626",
"#534136", "#4d3424", "#534b45", "#553724", "#574c45",
"#373942", "#40424a", "#363b4f", "#2c2d32", "#444651",
"#454545", "#39393b", "#4b4b4c", "#363638", "#525252"
]
),
("terrace", [
"#86898c", "#5e656c", "#6d6868", "#6d6c68", "#46443d",
"#3d4546", "#6b7071", "#716b70", "#738684", "#868073"
]
),
("hangar", [
"#403a33", "#4f4b46", "#413629", "#574c3f", "#3a2e21",
"#aaaeb6", "#939cac", "#8a919d", "#a0b9bf", "#8d999b",
"#49575a", "#273d43", "#313a3c", "#484f50", "#212d30"
]
),
("school", [
"#373942", "#40424a", "#363b4f", "#2c2d32", "#444651",
"#454545", "#39393b", "#4b4b4c", "#363638", "#525252"
]
),
("kindergarten", [
"#373942", "#40424a", "#363b4f", "#2c2d32", "#444651",
"#454545", "#39393b", "#4b4b4c", "#363638", "#525252"
]
),
("public", [
"#373942", "#40424a", "#363b4f", "#2c2d32", "#444651",
"#454545", "#39393b", "#4b4b4c", "#363638", "#525252"
]
),
("commercial", [
"#403a33", "#4f4b46", "#413629", "#574c3f", "#3a2e21",
"#aaaeb6", "#939cac", "#8a919d", "#a0b9bf", "#8d999b",
"#49575a", "#273d43", "#313a3c", "#484f50", "#212d30"
]
),
("yes", [
"#373942", "#40424a", "#363b4f", "#2c2d32", "#444651",
"#454545", "#39393b", "#4b4b4c", "#363638", "#525252"
]
)
]
# Base colors to add some details to all kinds of buildings
mstr_building_detail_colors = [
(136, 132, 86), # Some kind of moss
(136, 90, 86), # Some kind of rust or darkening
(154, 154, 154), # Other random details
(97, 97, 97) # Square or line details, alpha-blended
]
mstr_completion_colors = [
("+50+000", [
(48,63,34),
(81,95,64),
(105,100,64),
(91,105,72),
(78,69,41),
(116,113,78),
(90,94,69),
(58,68,40),
(57,72,41),
(93,103,76),
(139,142,111),
(92,102,73),
(71,86,55),
(103,105,91),
(96,78,56),
(143,141,113),
(107,108,74),
(41,56,34),
(51,63,41),
(137,137,107)
]
)
]