Exemple #1
0
    user='******',
    password='',
    sslmode='allow',
    prefix='osm_new_',
    proj='epsg:900913',
)

# WHERE "natural" IN ('water', 'bay')
# 	 OR waterway = 'riverbank'
# 	 OR landuse = 'reservoir'

water_areas = Polygons(name='water_areas',
                       fields=(('area', PseudoArea()), ),
                       mapping={
                           'natural': ('water', 'bay'),
                           'waterway': ('riverbank', ),
                           'landuse': ('reservoir', )
                       })

water_areas_z13 = GeneralizedTable(
    name='water_areas_z13',
    tolerance=zoom_threshold(13),
    origin=water_areas,
)

water_areas_z10 = GeneralizedTable(
    name='water_areas_z10',
    tolerance=zoom_threshold(10),
    origin=water_areas_z13,
)
Exemple #2
0
                   mapping={
                       'amenity': (
                           'university',
                           'school',
                           'library',
                           'fuel',
                           'hospital',
                           'fire_station',
                           'police',
                           'townhall',
                       ),
                   })

motorways_gen1 = GeneralizedTable(
    name='motorways_gen1',
    tolerance=meter_to_mapunit(50.0),
    origin=motorways,
)

mainroads_gen1 = GeneralizedTable(
    name='mainroads_gen1',
    tolerance=meter_to_mapunit(50.0),
    origin=mainroads,
)

railways_gen1 = GeneralizedTable(
    name='railways_gen1',
    tolerance=meter_to_mapunit(50.0),
    origin=railways,
)
Exemple #3
0
                       fields=(('area', PseudoArea()), ),
                       mapping={
                           'leisure':
                           ('park', 'water_park', 'marina', 'nature_reserve',
                            'playground', 'garden', 'common', 'sports_centre',
                            'golf_course', 'stadium', 'track', 'pitch'),
                           'landuse':
                           ('cemetery', 'park', 'water_park', 'marina',
                            'nature_reserve', 'playground', 'garden', 'common',
                            'forest', 'wood'),
                           'amenity': ('graveyard')
                       })

green_areas_z13 = GeneralizedTable(
    name='green_areas_z13',
    tolerance=zoom_threshold(13),
    origin=green_areas,
)

green_areas_z10 = GeneralizedTable(
    name='green_areas_z10',
    tolerance=zoom_threshold(10),
    origin=green_areas_z13,
)

# WHERE amenity IN ('school', 'college', 'university', 'bus_station',
#                   'ferry_terminal', 'hospital', 'kindergarten',
#                   'place_of_worship', 'public_building', 'townhall')
#    OR landuse IN ('industrial', 'commercial')

grey_areas = Polygons(name='grey_areas',
Exemple #4
0
                   mapping={
                       'amenity': (
                           'university',
                           'school',
                           'library',
                           'fuel',
                           'hospital',
                           'fire_station',
                           'police',
                           'townhall',
                       ),
                   })

roads_gen1 = GeneralizedTable(
    name='roads_gen1',
    tolerance=meter_to_mapunit(50.0),
    origin=roads,
    where="type in ('motorway','trunk','primary','secondary','tertiary')",
)
roads_gen0 = GeneralizedTable(
    name='roads_gen0',
    tolerance=meter_to_mapunit(200.0),
    origin=roads_gen1,
    where="type in ('motorway','trunk','primary')",
)

railways_gen1 = GeneralizedTable(
    name='railways_gen1',
    tolerance=meter_to_mapunit(50.0),
    origin=railways,
)
railways_gen0 = GeneralizedTable(