Skip to content

Instantly share code, notes, and snippets.

@dkerkow
Created January 21, 2014 15:32
Show Gist options
  • Save dkerkow/8542255 to your computer and use it in GitHub Desktop.
Save dkerkow/8542255 to your computer and use it in GitHub Desktop.
railways = Highway(
name = 'railways',
mapping = {
'railway': (
'rail',
'tram',
'light_rail',
'subway',
'narrow_gauge',
'preserved',
'disused',
'abandoned',
),
})
routes = LineStrings(
name = 'routes',
fields = (
('name', String()),
('colour', Colour()),
('ref', String()),
('operator', String()),
('color', Colour()),
('osmc:symbol', String()),
('wikipedia', String()),
),
mapping = {
'route': (
'__any__',
),
}
)
amenities = Points(
name='amenities',
fields = (
('addr:city', String()),
('addr:street', String()),
('addr:housenumber', String()),
),
mapping = {
'amenity': (
'bus_station',
'bicycle_parking',
'bicycle_rental',
'fuel',
'parking',
),
'highway': (
'motorway_junction',
'bus_stop',
'bus_station',
),
'railway': (
'station',
'stop',
'halt',
'tram_stop',
'subway_entrance',
),
})
amenities_poly = Centroids(
name='amenities_poly',
fields = (
('addr:city', String()),
('addr:street', String()),
('addr:housenumber', String()),
),
mapping = {
'amenity': (
'bus_station',
'bicycle_parking',
'bicycle_rental',
'fuel',
'parking',
),
'highway': (
'motorway_junction',
'bus_stop',
'bus_station',
),
'railway': (
'station',
'stop',
'halt',
'tram_stop',
'platform',
'subway_entrance',
),
'aeroway': (
'aerodome',
'terminal',
'helipad',
'gate',
),
})
pois = UnionView(
name = 'pois',
fields = (
('addr:city', 0),
('addr:street', 0),
('addr:housenumber', 0),
),
mappings = [amenities, amenities_poly],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment