<commit_before>import os
from datetime import date

TODAY_DATE = date.today().strftime("%D")

LANDMAPPER_DIR = os.path.dirname(os.path.abspath(__file__))

###########################################
##      Keys                            ###
###########################################
MAPBOX_TOKEN = 'set_in_landmapper_local_settings'

###########################################
##      Map Scales                      ###
###########################################
# Closest: 'fit' -- fits the property as close as possible
# Moderate: 'medium' -- approximately zoom level 12 unless the property is too big
# Regional Context: 'context' -- appx zoom 14 unless the property is larger
PROPERTY_OVERVIEW_SCALE = 'fit'
STREET_SCALE = 'context'
TOPO_SCALE = 'medium'
CONTOUR_SCALE = TOPO_SCALE
AERIAL_SCALE = PROPERTY_OVERVIEW_SCALE
TAXLOTS_SCALE = AERIAL_SCALE
SOIL_SCALE = AERIAL_SCALE
STREAM_SCALE = AERIAL_SCALE
STUDY_REGION = {
    'north': 46.292035,
    'south': 41.991794,
    'east': -116.463504,
    'west': -124.566244,
    'context': [
        ', OR',
        ', Oregon USA',
        # ', WA',
    ]
}


###########################################
##      Basemaps                        ###
###########################################
BASEMAPS = {
    'USGS_Aerial': {
        'URL': 'https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/export',
        'LAYERS': '0',
        'TECHNOLOGY': 'arcgis_mapserver',
        'ATTRIBUTION': 'USGS The National Map: Orthoimagery. Data refreshed April, 2019.'
    },
    'ESRI_Satellite': {
        'URL': 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/export',
        'LAYERS': '0',
        'TECHNOLOGY': 'arcgis_mapserver',
        'ATTRIBUTION': 'Source: Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community'
    },
    'ESRI_Topo': {
        'URL': 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/export',
        'LAYERS': '0',
        'TECHNOLOGY': 'arcgis_mapserver',
        'ATTRIBUTION': 'Sources: Esri, HERE, Garmin, Intermap, increment P Corp., GEBCO, USGS, FAO, NPS, NRCAN, GeoBase, IGN, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), (c) OpenStreetMap contributors, and the GIS User Community'
    },
    'ESRI_Street': {
        'URL': 'https://server.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer/export',
        'LAYERS': '0',
        'TECHNOLOGY': 'arcgis_mapserver',
        'ATTRIBUTION': 'Sources: Esri, HERE, Garmin, USGS, Intermap, INCREMENT P, NRCan, Esri Japan, METI, Esri China (Hong Kong), Esri Korea, Esri (Thailand), NGCC, (c) OpenStreetMap contributors, and the GIS User Community'
    },
    'Custom_Topo': {
        'URL': 'https://api.mapbox.com/styles/v1/{userid}/cke0j10sj1gta19o9agb1w8pq/tiles/256/{zoom}/{lon}/{lat}@2x?',
        'TECHNOLOGY': 'XYZ',
        'ATTRIBUTION': 'Sources: MapBox',
        'PARAMS': {
            'userid':'forestplanner',
            'layerid': 'cke0j10sj1gta19o9agb1w8pq',
            'lon': '',
            'lat': '',
            'zoom': '',
        },
        'QS': [
            'access_token=%s' % MAPBOX_TOKEN,
        ],
        # calculate tile assuming 256 px
        'TILE_HEIGHT': 256,
        'TILE_WIDTH': 256,
        # retrieve image at 2x resolution
        'TILE_IMAGE_HEIGHT': 512,
        'TILE_IMAGE_WIDTH': 512,
        'ZOOM_2X': False
    }
}

AERIAL_DEFAULT = 'ESRI_Satellite'
TOPO_DEFAULT = 'Custom_Topo'
# TOPO_DEFAULT = 'ESRI_Topo'
STREET_DEFAULT = 'ESRI_Street'

###########################################
##      REPORTS                         ###
###########################################
# Based on map size on slide 4 in the XD Specs
# This assumes the 'landscape' report layout (image will feel like 'portrait')
# REPORT_MAP_WIDTH = 509
REPORT_MAP_WIDTH = 768
# REPORT_MAP_HEIGHT = 722
REPORT_MAP_HEIGHT = 816

# REPORT_CONTENT_WIDTH = 508
REPORT_CONTENT_WIDTH = 767
REPORT_CONTENT_HEIGHT = REPORT_MAP_HEIGHT

REPORT_SUPPORT_ORIENTATION = False

REPORT_MAP_MIN_BUFFER = 0.1

# These values approximate zoom 12 & 14 at the Oregon/California border.
# MAX_METER_RESOLUTION_CONTEXT = 30.0  # ~15,000m/509px (current pixel width)
# MAX_METER_RESOLUTION_MEDIUM = 7.5   # 30/4 (or more illustratively: 30/2/2)

# MAX width resolution in 3857 degrees:
# MAX_WEB_MERCATOR_RESOLUTION_CONTEXT = 40  # ~20,000 degrees/509px (current pixel width)
MAX_WEB_MERCATOR_RESOLUTION_CONTEXT = 26  # ~20,000 degrees/768 (current pixel width)
# MAX_WEB_MERCATOR_RESOLUTION_MEDIUM = 10   # 40/4 (or more illustratively: 40/2/2)
MAX_WEB_MERCATOR_RESOLUTION_MEDIUM = 6.5   # 26/4 (or more illustratively: 26/2/2)

###########################################
##      REPORTS                         ###
###########################################
# SCALEBAR_DEFAULT_WIDTH = 1.5
SCALEBAR_DEFAULT_WIDTH = 6.4141
# SCALEBAR_DEFAULT_HEIGHT = 0.2
SCALEBAR_DEFAULT_HEIGHT = 0.5995
# SCALEBAR_BG_W = 508
SCALEBAR_BG_W = 616
# SCALEBAR_BG_H = 70
SCALEBAR_BG_H = 58

###########################################
##      Properties                      ###
###########################################
# PROPERTY_OUTLINE_COLOR = (255,0,255,255)
PROPERTY_OUTLINE_COLOR = (1,0,1,1)  # matplotlib does not understand 0-255, only hex or 0-1.0 vals
PROPERTY_OUTLINE_WIDTH = 1


###########################################
##      Soils                           ###<commit_msg>New scalebar and image measurements<commit_after>import os
from datetime import date

TODAY_DATE = date.today().strftime("%D")

LANDMAPPER_DIR = os.path.dirname(os.path.abspath(__file__))

###########################################
##      Keys                            ###
###########################################
MAPBOX_TOKEN = 'set_in_landmapper_local_settings'

###########################################
##      Map Scales                      ###
###########################################
# Closest: 'fit' -- fits the property as close as possible
# Moderate: 'medium' -- approximately zoom level 12 unless the property is too big
# Regional Context: 'context' -- appx zoom 14 unless the property is larger
PROPERTY_OVERVIEW_SCALE = 'fit'
STREET_SCALE = 'context'
TOPO_SCALE = 'medium'
CONTOUR_SCALE = TOPO_SCALE
AERIAL_SCALE = PROPERTY_OVERVIEW_SCALE
TAXLOTS_SCALE = AERIAL_SCALE
SOIL_SCALE = AERIAL_SCALE
STREAM_SCALE = AERIAL_SCALE
STUDY_REGION = {
    'north': 46.292035,
    'south': 41.991794,
    'east': -116.463504,
    'west': -124.566244,
    'context': [
        ', OR',
        ', Oregon USA',
        # ', WA',
    ]
}


###########################################
##      Basemaps                        ###
###########################################
BASEMAPS = {
    'USGS_Aerial': {
        'URL': 'https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/export',
        'LAYERS': '0',
        'TECHNOLOGY': 'arcgis_mapserver',
        'ATTRIBUTION': 'USGS The National Map: Orthoimagery. Data refreshed April, 2019.'
    },
    'ESRI_Satellite': {
        'URL': 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/export',
        'LAYERS': '0',
        'TECHNOLOGY': 'arcgis_mapserver',
        'ATTRIBUTION': 'Source: Esri, DigitalGlobe, GeoEye, Earthstar Geographics, CNES/Airbus DS, USDA, USGS, AeroGRID, IGN, and the GIS User Community'
    },
    'ESRI_Topo': {
        'URL': 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/export',
        'LAYERS': '0',
        'TECHNOLOGY': 'arcgis_mapserver',
        'ATTRIBUTION': 'Sources: Esri, HERE, Garmin, Intermap, increment P Corp., GEBCO, USGS, FAO, NPS, NRCAN, GeoBase, IGN, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), (c) OpenStreetMap contributors, and the GIS User Community'
    },
    'ESRI_Street': {
        'URL': 'https://server.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer/export',
        'LAYERS': '0',
        'TECHNOLOGY': 'arcgis_mapserver',
        'ATTRIBUTION': 'Sources: Esri, HERE, Garmin, USGS, Intermap, INCREMENT P, NRCan, Esri Japan, METI, Esri China (Hong Kong), Esri Korea, Esri (Thailand), NGCC, (c) OpenStreetMap contributors, and the GIS User Community'
    },
    'Custom_Topo': {
        'URL': 'https://api.mapbox.com/styles/v1/{userid}/cke0j10sj1gta19o9agb1w8pq/tiles/256/{zoom}/{lon}/{lat}@2x?',
        'TECHNOLOGY': 'XYZ',
        'ATTRIBUTION': 'Sources: MapBox',
        'PARAMS': {
            'userid':'forestplanner',
            'layerid': 'cke0j10sj1gta19o9agb1w8pq',
            'lon': '',
            'lat': '',
            'zoom': '',
        },
        'QS': [
            'access_token=%s' % MAPBOX_TOKEN,
        ],
        # calculate tile assuming 256 px
        'TILE_HEIGHT': 256,
        'TILE_WIDTH': 256,
        # retrieve image at 2x resolution
        'TILE_IMAGE_HEIGHT': 512,
        'TILE_IMAGE_WIDTH': 512,
        'ZOOM_2X': False
    }
}

AERIAL_DEFAULT = 'ESRI_Satellite'
TOPO_DEFAULT = 'Custom_Topo'
# TOPO_DEFAULT = 'ESRI_Topo'
STREET_DEFAULT = 'ESRI_Street'

###########################################
##      REPORTS                         ###
###########################################
# Based on map size on slide 4 in the XD Specs
# This assumes the 'landscape' report layout (image will feel like 'portrait')
# REPORT_MAP_WIDTH = 509
REPORT_MAP_WIDTH = 768
# REPORT_MAP_HEIGHT = 722
REPORT_MAP_HEIGHT = 816

# REPORT_CONTENT_WIDTH = 508
REPORT_CONTENT_WIDTH = 616
REPORT_CONTENT_HEIGHT = REPORT_MAP_HEIGHT

REPORT_SUPPORT_ORIENTATION = False

REPORT_MAP_MIN_BUFFER = 0.1

# These values approximate zoom 12 & 14 at the Oregon/California border.
# MAX_METER_RESOLUTION_CONTEXT = 30.0  # ~15,000m/509px (current pixel width)
# MAX_METER_RESOLUTION_MEDIUM = 7.5   # 30/4 (or more illustratively: 30/2/2)

# MAX width resolution in 3857 degrees:
# MAX_WEB_MERCATOR_RESOLUTION_CONTEXT = 40  # ~20,000 degrees/509px (current pixel width)
MAX_WEB_MERCATOR_RESOLUTION_CONTEXT = 26  # ~20,000 degrees/768 (current pixel width)
# MAX_WEB_MERCATOR_RESOLUTION_MEDIUM = 10   # 40/4 (or more illustratively: 40/2/2)
MAX_WEB_MERCATOR_RESOLUTION_MEDIUM = 6.5   # 26/4 (or more illustratively: 26/2/2)

###########################################
##      REPORTS                         ###
###########################################
SCALEBAR_DEFAULT_WIDTH = 1.5
SCALEBAR_DEFAULT_HEIGHT = 0.2
# SCALEBAR_BG_W = 508
SCALEBAR_BG_W = 616
# SCALEBAR_BG_H = 70
SCALEBAR_BG_H = 58

###########################################
##      Properties                      ###
###########################################
# PROPERTY_OUTLINE_COLOR = (255,0,255,255)
PROPERTY_OUTLINE_COLOR = (1,0,1,1)  # matplotlib does not understand 0-255, only hex or 0-1.0 vals
PROPERTY_OUTLINE_WIDTH = 1


###########################################
##      Soils                           ###
{'fraction_non_alphanumeric': 0.21168083356183165, 'fraction_numerical': 0.03911891052006215, 'mean_word_length': 3.4317537464560552, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2457516', 'n_tokens_mistral': 4069, 'n_tokens_neox': 3655, 'n_words': 758}