orthographic/defines.py

205 lines
7.0 KiB
Python

# -------------------------------------------------------------------
# ORTHOGRAPHIC
# Your personal aerial satellite. Always on. At any altitude.*
# Developed by MarStrMind
# License: MIT
# 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\\"
# 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 # <- Change this to 4096 for 16k resolution
# Radius of zoom level 18 aerials around airports with ICAO code
mstr_airport_radius = 2
# 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 = 24
# The tags that cast shadows
mstr_shadow_casters = [
("landuse", "forest"),
("building", "yes"),
("building", "office"),
("building", "retail"),
("building", "industrial"),
("leisure", "nature_reserve")
]
# 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
("landuse", "residential", "landuse", "residential-boundary"),
("boundary", "administrative", "admin_level", ["8", "9", "10", "12"], "landuse", "residential-boundary"),
# Z-Order 1
("landuse", "grass", "landuse", "grass"),
("landuse", "cemetery", "landuse", "grass"),
("landuse", "greenfield", "landuse", "grass"),
("landuse", "orchard", "landuse", "meadow"),
("landuse", "meadow", "landuse", "meadow"),
("landuse", "recreation_ground", "landuse", "meadow"),
("leisure", "golf_course", "leisure", "golf_course"),
("barrier", "hedge", "natural", "heath"),
("landuse", "vineyard", "landuse", "meadow"),
("highway", "track", 3),
("highway", "path", 3),
("natural", "bare_rock", "natural", "bare_rock"),
("natural", "grassland", "landuse", "meadow"),
("natural", "wetland", "natural", "wetland"),
("natural", "scrub", "natural", "scrub"),
("natural", "heath", "natural", "heath"),
("leisure", "park", "leisure", "green"),
("leisure", "dog_park", "leisure", "green"),
("leisure", "garden", "leisure", "green"),
("leisure", "sports_centre", "leisure", "green"),
("leisure", "pitch", "leisure", "green"),
("landuse", "farmland", "landuse", "farmland"),
("landuse", "farmyard", "landuse", "farmland"),
# Z-Order 2
("landuse", "forest", "landuse", "forest"),
("leisure", "nature_reserve", "landuse", "forest"),
("landuse", "military", "landuse", "residential-boundary"),
# Z-Order 3
("natural", "water", "natural", "water"),
("natural", "bay", "natural", "beach"),
("natural", "beach", "natural", "beach"),
("water", "lake", "natural", "water"),
("water", "pond", "natural", "water"),
("water", "river", "natural", "water"),
("waterway", "river", "natural", "water"),
("waterway", "stream", 10),
("amenity", "parking", "amenities", "parking"),
("highway", "pedestrian", 4),
# Z-Order 4
("highway", "motorway", 32),
("highway", "primary", 14),
("highway", "secondary", 13),
("highway", "tertiary", 12),
("highway", "unclassified", 12),
("highway", "living_street", 12),
("highway", "residential", 12),
("highway", "service", 6),
("highway", "footway", 4),
("railway", "rail", 5),
# Z-Order 5
("aeroway", "taxiway", 42),
("aeroway", "runway", 80),
("building", "office", "building", "office"),
("building", "retail", "building", "industrial"),
("building", "industrial", "building", "industrial"),
("building", "yes", "building", "common")
]
# Blur values for the single masks of the ortho layers
mstr_mask_blur = [
# Z-Order 0
("landuse", "residential", 5),
("boundary", "administrative", 5),
# Z-Order 1
("landuse", "grass", 10),
("landuse", "cemetery", 10),
("landuse", "greenfield", 10),
("landuse", "orchard", 10),
("landuse", "meadow", 10),
("barrier", "hedge", 4),
("landuse", "recreation_ground", 10),
("landuse", "vineyard", 10),
("natural", "grassland", 10),
("natural", "wetland", 10),
("natural", "scrub", 10),
("natural", "heath", 10),
("leisure", "park", 10),
("leisure", "golf_course", 15),
("leisure", "dog_park", 12),
("leisure", "garden", 12),
("leisure", "sports_centre", 12),
("leisure", "pitch", 10),
("landuse", "farmland", 10),
("landuse", "farmyard", 10),
# Z-Order 2
("landuse", "forest", 10),
("leisure", "nature_reserve", 10),
("landuse", "military", 10),
# Z-Order 3
("natural", "bare_rock", 12),
("natural", "water", 12),
("natural", "bay", 12),
("natural", "beach", 15),
("water", "lake", 10),
("water", "pond", 10),
("water", "river", 10),
("waterway", "river", 10),
("waterway", "stream", 8),
("amenity", "parking", 10),
("highway", "pedestrian", 4),
# Z-Order 4
("highway", "motorway", 4),
("highway", "primary", 3),
("highway", "secondary", 2),
("highway", "tertiary", 2),
("highway", "unclassified", 2),
("highway", "living_street", 4),
("highway", "residential", 4),
("highway", "service", 4),
("highway", "footway", 4),
("highway", "track", 3),
("highway", "path", 3),
("railway", "rail", 4),
# Z-Order 5
("aeroway", "taxiway", 12),
("aeroway", "runway", 12),
("building", "office", 4),
("building", "retail", 4),
("building", "industrial", 4),
("building", "yes", 4)
]
# Define tile main colors by latitude-longitude region
mstr_base_colors = [
((50,0), 100, 106, 77)
]