Example #1
0
from config.common import *

MAPTYPE = 'routes'

DB_SCHEMA = 'mtb'
DB_TABLES = RouteDBTables()

DB_ROUTE_SUBSET = """
    tags ? 'route' and tags->>'type' IN ('route', 'superroute')
    AND 'mtb' = any(regexp_split_to_array(tags->>'route', ';'))
    AND NOT (tags ? 'state' AND tags->>'state' = 'proposed')"""

ROUTES = RouteTableConfig()
ROUTES.network_map = {
    'icn': Network.INT(0),
    'ncn': Network.NAT(0),
    'rcn': Network.REG(0),
    'lcn': Network.LOC(0)
}
ROUTES.symbols = ('.swiss_mobile', '.jel_symbol', '.ref_symbol', '.color_box')
ROUTES.symbol_datadir = os.path.join(MEDIA_DIR, 'symbols/cycling')

GUIDEPOSTS = GuidePostConfig()
GUIDEPOSTS.subtype = 'mtb'
GUIDEPOSTS.require_subtype = True

DEFSTYLE = RouteNetworkStyle()

SYMBOLS = WmtConfig()
SYMBOLS.swiss_mobil_bgcolor = (0.88, 0.83, 0.32)
MAPTYPE = 'routes'

DB_SCHEMA = 'hiking'
DB_TABLES = RouteDBTables()

DB_ROUTE_SUBSET = """
    tags ? 'route' and tags->>'type' IN ('route', 'superroute')
    AND array['hiking', 'foot', 'walking'] && regexp_split_to_array(tags->>'route', ';')
    AND NOT (tags ? 'state' AND tags->>'state' = 'proposed')"""

DEFSTYLE = RouteNetworkStyle()
DEFSTYLE.add_to_collector = MethodType(hiking_add_to_collector, DEFSTYLE)

ROUTES = RouteTableConfig()
ROUTES.network_map = {
        'iwn': Network.INT(),
        'nwn': Network.NAT(),
        'rwn': Network.REG(),
        'lwn': Network.LOC()
        }
ROUTES.tag_filter = filter_route_tags
ROUTES.symbols = ( '.image_symbol',
                   '.swiss_mobile',
                   '.jel_symbol',
                   '.kct_symbol',
                   '.cai_hiking_symbol',
                   '.osmc_symbol',
                   '.ref_color_symbol',
                   '.ref_symbol')
ROUTES.symbol_datadir = os.path.join(MEDIA_DIR, 'symbols/hiking')