Beispiel #1
0
 def test_multiple_mappings(self):
     roads = LineStrings(name='roads',
                         mapping={
                             'highway': ('secondary', ),
                             'railway': ('tram', ),
                         })
     tag_mapping = TagMapper([roads])
     for_ways = tag_mapping.for_ways
     eq_mapping(for_ways({'unknown': 'baz'}), [])
     eq_mapping(for_ways({'highway': 'unknown'}), [])
     eq_mapping(for_ways({'highway': 'secondary'}),
                [(('highway', 'secondary'), ('roads', ))])
     eq_mapping(for_ways({
         'highway': 'secondary',
         'railway': 'tram'
     }), [(('railway', 'tram'), ('roads', )),
          (('highway', 'secondary'), ('roads', ))])
Beispiel #2
0
buildings_z13 = GeneralizedTable(
    name='buildings_z13',
    tolerance=zoom_threshold(13),
    origin=buildings,
)

buildings_z10 = GeneralizedTable(
    name='buildings_z10',
    tolerance=zoom_threshold(10),
    origin=buildings_z13,
)

# WHERE aeroway IS NOT NULL

aeroways = LineStrings(name='aeroways', mapping={'aeroway': ('__any__', )})

aeroways_z13 = GeneralizedTable(
    name='aeroways_z13',
    tolerance=zoom_threshold(13),
    origin=aeroways,
)

aeroways_z10 = GeneralizedTable(
    name='aeroways_z10',
    tolerance=zoom_threshold(10),
    origin=aeroways_z13,
)

# WHERE waterway IS NOT NULL
                                  'helipad',
                                  'gate',
                              )
                          })

railways = LineStrings(
    name='railways',
    fields=(
        ('tunnel', Bool()),
        ('bridge', Bool()),
        # ('ref', String()),
        ('layer', Integer()),
        ('z_order', WayZOrder()),
        ('access', String()),
    ),
    mapping={
        'railway': (
            'rail',
            'tram',
            'light_rail',
            'subway',
            'narrow_gauge',
            'preserved',
            'funicular',
            'monorail',
        )
    })

waterways = LineStrings(
    name='waterways',
    mapping={
        'barrier': ('ditch', ),
Beispiel #4
0
                                  'terminal',
                                  'helipad',
                                  'gate',
                              )
                          })

railways = LineStrings(
    name='railways',
    fields=(
        ('tunnel', Bool()),
        ('bridge', Bool()),
        # ('ref', String()),
        ('z_order', WayZOrder()),
    ),
    mapping={
        'railway': (
            'rail',
            'tram',
            'light_rail',
            'subway',
            'narrow_gauge',
            'preserved',
            'funicular',
            'monorail',
        )
    })

waterways = LineStrings(
    name='waterways',
    mapping={'waterway': (
        'stream',
        'river',
Beispiel #5
0
             'city',
             'town',
             'village',
             'hamlet',
             'suburb',
             'neighbourhood',
             'locality',
         ])),
        ('population', Integer()),
    ),
)

admin = LineStrings(
    name='admin',
    mapping={
        'boundary': ('administrative', ),
    },
    fields=(('admin_level', Integer()), ),
)

motorways = Highway(name='motorways',
                    mapping={
                        'highway': (
                            'motorway',
                            'motorway_link',
                            'trunk',
                            'trunk_link',
                        ),
                    })

mainroads = Highway(name='mainroads',
	},
	fields = (
		('access', String()),
		('bicycle_parking', String()),
		('operator', String()),
		('railway', String())
	),
)

sensuniques = LineStrings(
	name = 'sensuniques',
	mapping = { 
		'oneway' : ('yes','1','-1'),
	},
	fields = (
		('highway', String()),
		('cycleway', String()),
		('cycleway:left', String()),
		('cycleway:right', String()),
		('maxspeed', Integer()),
	),
)

equipements = LineStrings(
    name = 'cyclelanes',
    mapping = { 'cycleway': (
		    'lane',    
		    'track',    
		    'opposite_lane',   
		    'opposite_track',  
		    'opposite',
Beispiel #7
0
            'road',
        ),
    }
)

tracks = LineStrings(
    name = 'tracks',
    fields = (
        ('name', Name()),
        ('name:en', Name()),
        ('name:de', Name()),
        ('name:ru', Name()),
        ('tunnel', Bool()),
        ('bridge', Bool()),
        ('layer', Integer()),
        ('access', String()),
        ('tracktype', String()),
    ),
    field_filter = (
        ('area', Bool()),
    ),
    mapping = {
        'highway': (
            'track',
        ),
    }
)

paths = LineStrings(
    name = 'paths',
    fields = (
        ('tunnel', Bool()),
Beispiel #8
0
            'terminal',
            'helipad',
            'gate',
    )}
)

railways = LineStrings(
    name = 'railways',
    fields = (
        ('tunnel', Bool()),
        ('bridge', Bool()),
        # ('ref', String()),
        ('z_order', WayZOrder()),
    ),
    mapping = {
        'railway': (
            'rail',
            'tram',
            'light_rail',
            'subway',
            'narrow_gauge',
            'preserved',
            'funicular',
            'monorail',
    )}
)

waterways = LineStrings(
    name = 'waterways',
    mapping = {
        'waterway': (
            'stream',
Beispiel #9
0
                                  'helipad',
                                  'gate',
                              )
                          })

railways = LineStrings(
    name='railways',
    fields=(
        ('tunnel', Bool()),
        ('bridge', Bool()),
        # ('ref', String()),
        ('layer', Integer()),
        ('z_order', WayZOrder()),
        ('access', String()),
    ),
    mapping={
        'railway': (
            'rail',
            'tram',
            'light_rail',
            'subway',
            'narrow_gauge',
            'preserved',
            'funicular',
            'monorail',
        )
    })

waterways = LineStrings(
    name='waterways',
    mapping={
        'barrier': ('ditch', ),
Beispiel #10
0
                                  'helipad',
                                  'gate',
                              )
                          })

railways = LineStrings(
    name='railways',
    fields=(
        ('tunnel', Bool()),
        ('bridge', Bool()),
        # ('ref', String()),
        ('layer', Integer()),
        ('z_order', WayZOrder()),
        ('access', String()),
    ),
    mapping={
        'railway': (
            'rail',
            'tram',
            'light_rail',
            'subway',
            'narrow_gauge',
            'preserved',
            'funicular',
            'monorail',
        )
    })

waterways = LineStrings(
    name='waterways',
    mapping={
        'barrier': ('ditch', ),