How to use the routemap.common.symbols.get_symbol function in routemap

To help you get started, we’ve selected a few routemap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github waymarkedtrails / waymarked-trails-site / db / src / routemap / mtbmap / relations.py View on Github external
'top' : None}

        # default treatment of tags
        for (k,v) in tags.iteritems():
            if k == 'name':
                outtags[k] = v
            elif k.startswith('name:'):
                outtags['intnames'][k[5:]] = v
            elif k == 'ref':
                if 'name' not in outtags:
                    outtags['name'] = '[%s]' % v
            elif k == 'network':
                outtags['level'] = conf.TAGS_NETWORK_MAP.get(v, 25)


        outtags['symbol'] = symbols.get_symbol(outtags['level'], None, tags, symboltypes)

        cur = self.thread.cursor

        if 'name' not in outtags:
            outtags['name'] = '(%s)' % osmid

        if outtags['top'] is None:
            if 'network' in tags:
                top = self.db.select_one("EXECUTE get_route_top(%s, %s)",
                              (osmid, tags['network']), cur=cur)
                outtags['top'] = (top is None)
            else:
                outtags['top'] = True

        # finally: compute the geometry
        routelines = self.db.select_column("EXECUTE get_route_geometry(%s)",
github waymarkedtrails / waymarked-trails-site / db / src / routemap / slopemap / relations.py View on Github external
outtags['name'] = '(%s)' % osmid

        # default treatment of tags
        for (k,v) in tags.iteritems():
            if k == 'piste:difficulty':
                if v in conf.TAGS_DIFFICULTY_MAP.keys():
                    outtags[v] = True
                    difficulty = conf.TAGS_DIFFICULTY_MAP[v]
            if k == 'piste:type':
                if v in conf.TAGS_PISTETYPE_MAP.keys():
                    outtags[v] = True
            if k.startswith('name:'):
                outtags['intnames'][k[5:]] = v
                    

        outtags['symbol'] = symbols.get_symbol(difficulty, None, tags, symboltypes)

        cur = self.thread.cursor

        if 'name' not in outtags:
            outtags['name'] = '(%s)' % osmid

        if outtags['top'] is None:
            if 'network' in tags:
                top = self.db.select_one("EXECUTE get_route_top(%s, %s)",
                              (osmid, tags['network']), cur=cur)
                outtags['top'] = True if (top == 0) else False
            else:
                outtags['top'] = True

        # finally: compute the geometry
        routelines = self.db.select_column("EXECUTE get_route_geometry(%s)",
github waymarkedtrails / waymarked-trails-site / db / src / routemap / riding / relations.py View on Github external
'top' : None}

        # default treatment of tags
        for (k,v) in tags.iteritems():
            if k == 'name':
                outtags[k] = v
            elif k.startswith('name:'):
                outtags['intnames'][k[5:]] = v
            elif k == 'ref':
                if 'name' not in outtags:
                    outtags['name'] = '[%s]' % v
            elif k == 'network':
                outtags['level'] = conf.TAGS_NETWORK_MAP.get(v, 25)


        outtags['symbol'] = symbols.get_symbol(outtags['level'], None, tags, symboltypes)

        cur = self.thread.cursor

        if 'name' not in outtags:
            outtags['name'] = '(%s)' % osmid

        if outtags['top'] is None:
            if 'network' in tags:
                top = self.db.select_one("EXECUTE get_route_top(%s, %s)",
                              (osmid, tags['network']), cur=cur)
                outtags['top'] = True if (top == 0) else False
            else:
                outtags['top'] = True

        # finally: compute the geometry
        routelines = self.db.select_column("EXECUTE get_route_geometry(%s)",
github waymarkedtrails / waymarked-trails-site / db / src / routemap / hiking / relations.py View on Github external
if ot.startswith('yellow:'):
                outtags['network'] = 'CH'
                outtags['level'] = 31
            if ot.startswith('red:'):
                outtags['network'] = 'CH'
                outtags['level'] = 32
            if ot.startswith('blue:'):
                outtags['network'] = 'CH'
                outtags['level'] = 33

        # Fränkischer Albverein (around Nürnberg)
        #  too extensive regional network, so we need to downgrade later
        if tags.get('operator') == u'Fränkischer Albverein':
            outtags['network'] = 'FA'
            
        outtags['symbol'] = symbols.get_symbol(outtags['level'], cntry, tags, symboltypes)
        outtags['country'] = cntry

        if 'name'not in outtags:
            outtags['name'] = '(%s)' % osmid

        if outtags['top'] is None:
            if 'network' in tags:
                top = self.db.select_one("EXECUTE get_route_top(%s, %s)",
                              (osmid, tags['network']), cur=cur)
                outtags['top'] = (top is None)
            else:
                outtags['top'] = True

        return outtags
github waymarkedtrails / waymarked-trails-site / db / src / routemap / cycling / relations.py View on Github external
'top' : None}

        # default treatment of tags
        for (k,v) in tags.iteritems():
            if k == 'name':
                outtags[k] = v
            elif k.startswith('name:'):
                outtags['intnames'][k[5:]] = v
            elif k == 'ref':
                if 'name' not in outtags:
                    outtags['name'] = '[%s]' % v
            elif k == 'network':
                outtags['level'] = conf.TAGS_NETWORK_MAP.get(v, 35)


        outtags['symbol'] = symbols.get_symbol(outtags['level'], None, tags, symboltypes)

        cur = self.thread.cursor

        if 'name' not in outtags:
            outtags['name'] = '(%s)' % osmid

        if outtags['top'] is None:
            if 'network' in tags:
                top = self.db.select_one("EXECUTE get_route_top(%s, %s)",
                              (osmid, tags['network']), cur=cur)
                outtags['top'] = True if (top == 0) else False
            else:
                outtags['top'] = True

        # finally: compute the geometry
        routelines = self.db.select_column("EXECUTE get_route_geometry(%s)",
github waymarkedtrails / waymarked-trails-site / db / src / routemap / skating / relations.py View on Github external
'top' : None}

        # default treatment of tags
        for (k,v) in tags.iteritems():
            if k == 'name':
                outtags[k] = v
            elif k.startswith('name:'):
                outtags['intnames'][k[5:]] = v
            elif k == 'ref':
                if 'name' not in outtags:
                    outtags['name'] = '[%s]' % v
            elif k == 'network':
                outtags['level'] = conf.TAGS_NETWORK_MAP.get(v, 25)


        outtags['symbol'] = symbols.get_symbol(outtags['level'], None, tags, symboltypes)

        cur = self.thread.cursor

        if 'name' not in outtags:
            outtags['name'] = '(%s)' % osmid

        if outtags['top'] is None:
            if 'network' in tags:
                top = self.db.select_one("EXECUTE get_route_top(%s, %s)",
                              (osmid, tags['network']), cur=cur)
                outtags['top'] = True if (top == 0) else False
            else:
                outtags['top'] = True

        # finally: compute the geometry
        routelines = self.db.select_column("EXECUTE get_route_geometry(%s)",
github waymarkedtrails / waymarked-trails-site / db / src / routemap / slopemap / ways.py View on Github external
else:
            outtags['name'] = '(%s)' % osmid


        for (k,v) in tags.iteritems():
            if k == 'piste:difficulty':
                if v in conf.TAGS_DIFFICULTY_MAP.keys():
                    outtags[v] = True
                    difficulty = conf.TAGS_DIFFICULTY_MAP[v]
            if k == 'piste:type':
                if v in conf.TAGS_PISTETYPE_MAP.keys():
                    outtags[v] = True
            if k.startswith('piste:name:'):
                outtags['intnames'][k[11:]] = v
                    
        outtags['symbol'] = symbols.get_symbol(difficulty, None, tags, symboltypes)

        return outtags