예제 #1
0
    def test_place(self):
        import dsl

        z, x, y = (16, 10482, 25330)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/26819236
            dsl.point(
                26819236, (-122.4199061, 37.7790262), {
                    'name': u'San Francisco',
                    'place': u'city',
                    'population': u'864816',
                    'rank': u'10',
                    'short_name': u'SF',
                    'source': u'openstreetmap.org',
                    'wikidata': u'Q62',
                    'wikipedia': u'en:San Francisco',
                }), )

        self.assert_has_feature(
            z, x, y, 'places', {
                'id': 26819236,
                'kind': 'locality',
                'kind_detail': 'city',
                'wikidata_id': 'Q62',
            })
    def test_bicycle_shop_node(self):
        import dsl

        z, x, y = (16, 10479, 25331)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/2484293076
            dsl.point(2484293076, (-122.432202, 37.771036), {
                'addr:city': 'San Francisco',
                'addr:housenumber': '520',
                'addr:street': 'Waller Street',
                'name': 'Wiggle Bicycles',
                'opening_hours': 'Tu-Fr 10:00-18:30; Sa-Su 10:00-17:00',
                'service:bicycle:diy': 'no',
                'service:bicycle:pump': 'yes',
                'service:bicycle:repair': 'yes',
                'shop': 'bicycle',
                'source': 'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 2484293076,
                'kind': 'bicycle',
                'min_zoom': 17,
            })
    def test_current_railway_halt(self):
        # Current railway halt
        import dsl

        z, x, y = (16, 35826, 22751)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/302735255
            dsl.point(302735255, (16.8020704, 48.1080027), {
                'name': u'Wildungsmauer',
                'network': u'VOR',
                'operator': u'ÖBB-Infrastruktur AG',
                'public_transport': u'stop_position',
                'railway': u'halt',
                'railway:platform_height': u'38',
                'railway:platform_length': u'142',
                'railway:position': u'38.0',
                'railway:position:exact': u'37.985',
                'railway:ref': u'Reg H1',
                'ref': u'1',
                'source': u'openstreetmap.org',
                'train': u'yes',
                'uic_name': u'Wildungsmauer',
                'uic_ref': u'8101787',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 302735255,
                'kind': u'halt',
                'min_zoom': 16,
            })
예제 #4
0
    def test_place(self):
        import dsl

        z, x, y = (16, 10482, 25330)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/26819236
            dsl.point(26819236, (-122.4199061, 37.7790262), {
                'name': u'San Francisco',
                'place': u'city',
                'population': u'864816',
                'rank': u'10',
                'short_name': u'SF',
                'source': u'openstreetmap.org',
                'wikidata': u'Q62',
                'wikipedia': u'en:San Francisco',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'places', {
                'id': 26819236,
                'kind': 'locality',
                'kind_detail': 'city',
                'wikidata_id': 'Q62',
            })
    def test_school_17_node(self):
        import dsl

        z, x, y = (16, 10477, 25332)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/358803287
            dsl.point(358803287, (-122.445249, 37.769930), {
                'amenity': 'school',
                'ele': '83',
                'gnis:county_id': '075',
                'gnis:created': '11/01/1994',
                'gnis:feature_id': '1655405',
                'gnis:state_id': '06',
                'name': "Haight Ashbury Children's Center",
                'source': 'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 358803287,
                'kind': 'school',
                'min_zoom': 17,
            })
    def test_technical_bunker_node(self):
        import dsl

        z, x, y = (16, 31253, 23940)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/4955741213
            dsl.point(4955741213, (-8.318059, 43.563983), {
                'abandoned': u'yes',
                'bunker_type': u'technical',
                'description': u'Antigua batería militar',
                'historic': u'yes',
                'military': u'bunker',
                'name': u'Proyectores B6',
                'official_name': u'Batería Militar 6',
                'source': u'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 4955741213,
                'kind': u'bunker',
                'kind_detail': u'technical',
            })
    def test_station_node(self):
        import dsl

        z, x, y = (16, 10522, 25402)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/2160213344
            dsl.point(2160213344, (-122.197968, 37.464501), {
                'name': 'Atherton',
                'network': 'Caltrain',
                'note': 'Weekend local service only',
                'opening_hours': 'Sa,Su',
                'public_transport': 'station',
                'railway': 'halt',
                'source': 'openstreetmap.org',
                'wikidata': 'Q4813588',
                'wikipedia': 'en:Atherton (Caltrain station)',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 2160213344,
                'kind': 'station',
            })
    def test_theatre_node(self):
        import dsl

        z, x, y = (16, 10483, 25329)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/358805392
            dsl.point(358805392, (-122.411371, 37.782168), {
                'amenity': 'theatre',
                'ele': '14',
                'gnis:county_id': '075',
                'gnis:created': '01/01/1995',
                'gnis:feature_id': '1657186',
                'gnis:state_id': '06',
                'name': 'Market Street Theatre',
                'source': 'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 358805392,
                'kind': 'theatre',
                'min_zoom': 17,
            })
    def test_ne_min_zoom_should_override_default(self):
        import dsl
        from tilequeue.tile import deg2num

        lon, lat = (-3.2765753, 54.7023545)
        z = 5
        x, y = deg2num(lat, lon, z)

        self.generate_fixtures(
            dsl.is_in('GB', z, x, y),
            # https://www.openstreetmap.org/node/838090640
            dsl.point(838090640, (lon, lat), {
                'name': u'United Kingdom',
                'place': u'country',
                'population': u'61792000',
                'source': u'openstreetmap.org',
                'wikidata': u'Q145',
                'wikipedia': u'de:United Kingdom',  # LOL, de:
                # NE joins should override defaults from location
                '__ne_min_zoom': 0,
                '__ne_max_zoom': 16,
            }),
        )

        self.assert_has_feature(
            z, x, y, 'places', {
                'id': 838090640,
                'min_zoom': 0,
                'max_zoom': 16,
            })
    def test_taichung(self):
        import dsl

        z, x, y = (10, 855, 441)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/60655918
            dsl.point(
                60655918,
                (120.6478282, 24.163162),
                {
                    'name': u'臺中市',
                    'name:en': u'Taichung',
                    'place': u'city',
                    'population': u'2767239',
                    'source': u'openstreetmap.org',
                    'wikidata': u'Q245023',
                    'wikipedia': u'zh:臺中市',

                    # these come from NE data joined on wikidataid
                    'featurecla': 'Admin-1 capital',
                    'fclass_cn': 'Populated place',
                }), )

        self.assert_has_feature(
            z, x, y, 'places', {
                'id': 60655918,
                'region_capital': type(True),
                'region_capital:cn': type(False),
            })
    def test_united_kingdom(self):
        # in the absence of data joined from NE, we should fall back to a
        # default based on the country that the label point is in.
        import dsl
        from tilequeue.tile import deg2num

        lon, lat = (-3.2765753, 54.7023545)
        z = 5
        x, y = deg2num(lat, lon, z)

        self.generate_fixtures(
            dsl.is_in('GB', z, x, y),
            # https://www.openstreetmap.org/node/838090640
            dsl.point(
                838090640,
                (lon, lat),
                {
                    'name': u'United Kingdom',
                    'place': u'country',
                    'population': u'61792000',
                    'source': u'openstreetmap.org',
                    'wikidata': u'Q145',
                    'wikipedia': u'de:United Kingdom',  # LOL, de:
                }),
        )

        self.assert_has_feature(z, x, y, 'places', {
            'id': 838090640,
            'min_zoom': 1.7,
            'max_zoom': 6.7,
        })
    def test_ne_min_zoom_should_override_default(self):
        import dsl
        from tilequeue.tile import deg2num

        lon, lat = (-3.2765753, 54.7023545)
        z = 5
        x, y = deg2num(lat, lon, z)

        self.generate_fixtures(
            dsl.is_in('GB', z, x, y),
            # https://www.openstreetmap.org/node/838090640
            dsl.point(
                838090640,
                (lon, lat),
                {
                    'name': u'United Kingdom',
                    'place': u'country',
                    'population': u'61792000',
                    'source': u'openstreetmap.org',
                    'wikidata': u'Q145',
                    'wikipedia': u'de:United Kingdom',  # LOL, de:
                    # NE joins should override defaults from location
                    '__ne_min_zoom': 0,
                    '__ne_max_zoom': 16,
                }),
        )

        self.assert_has_feature(z, x, y, 'places', {
            'id': 838090640,
            'min_zoom': 0,
            'max_zoom': 16,
        })
예제 #13
0
    def test_direction_as_int_out_of_range_dash(self):
        import dsl

        z, x, y = (16, 10482, 25333)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/3109053718
            dsl.point(3109053718, (-122.4195493, 37.7653381), {
                'tourism': u'viewpoint',
                'direction': u'45-225',
            }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 3109053718,
            'kind': u'viewpoint',
        })

        self.assert_no_matching_feature(z, x, y, 'pois', {
            'id': 3109053718,
            'kind': u'viewpoint',
            'direction': u'45-225',
        })

        self.assert_no_matching_feature(z, x, y, 'pois', {
            'id': 3109053718,
            'kind': u'viewpoint',
            'direction': 180,
        })
예제 #14
0
    def test_travel_plaza(self):
        import dsl

        z, x, y = (13, 2410, 3053)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/450420567
            dsl.point(
                450420567, (-74.087849, 41.593617), {
                    'addr:city': u'Modena',
                    'addr:postcode': u'12548',
                    'addr:state': u'NY',
                    'alt_name': u'Modena Service Area',
                    'highway': u'services',
                    'internet_access': u'wlan',
                    'name': u'Modena Travel Plaza',
                    'operator': u'New York State Thruway Authority',
                    'source': u'openstreetmap.org',
                }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 450420567,
            'kind': u'service_area',
            'min_zoom': 13,
        })
    def test_wales(self):
        # wales is a country within the UK, but mapped as place=state.
        # should get a fallback from the states_provinces spreadsheet.
        import dsl

        z, x, y = (10, 501, 336)

        self.generate_fixtures(
            dsl.is_in('GB', z, x, y),
            # https://www.openstreetmap.org/node/2642288017
            dsl.point(
                2642288017, (-3.73893, 52.2928116), {
                    'is_in': u'United Kingdom, Europe',
                    'name': u'Wales',
                    'note': u'geographical centre of Wales',
                    'place': u'state',
                    'source': u'openstreetmap.org',
                }),
        )

        self.assert_has_feature(z, x, y, 'places', {
            'id': 2642288017,
            'min_zoom': 10,
            'max_zoom': 11,
        })
    def test_platform_bus_stop(self):
        import dsl

        z, x, y = (16, 10511, 25255)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/1866509704
            dsl.point(1866509704, (-122.259434, 38.100169), {
                'bus': 'yes',
                'covered': 'yes',
                'highway': 'platform',
                'local_ref': '85',
                'network': 'SolTrans',
                'operator': 'Soltrans',
                'public_transport': 'platform',
                'ref': 'Y',
                'source': 'openstreetmap.org',
                'wheelchair': 'yes',
                'wifi': 'free for guests',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 1866509704,
                'kind': 'bus_stop',
                'min_zoom': 18,
            })
예제 #17
0
    def test_combo(self):
        # tagged both military=airfield and aeroway=aerodrome, prefer
        # (military) airfield as per
        # https://github.com/tilezen/vector-datasource/issues/1580
        import dsl

        z, x, y = (16, 32459, 21686)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/412044660
            dsl.point(412044660, (-1.69678, 51.8666626), {
                'aeroway': u'aerodrome',
                'closest_town': u'Bourton-on-the-Water',
                'ele': u'223',
                'icao': u'EGVL',
                'military': u'airfield',
                'name': u'RAF Little Rissington',
                'operator': u'Royal Air Force',
                'source': u'openstreetmap.org',
                'wikidata': u'Q7275442',
                'wikipedia': u'en:RAF Little Rissington',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 412044660,
                'kind': u'airfield',
            })
    def test_travel_plaza(self):
        import dsl

        z, x, y = (13, 2410, 3053)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/450420567
            dsl.point(450420567, (-74.087849, 41.593617), {
                'addr:city': u'Modena',
                'addr:postcode': u'12548',
                'addr:state': u'NY',
                'alt_name': u'Modena Service Area',
                'highway': u'services',
                'internet_access': u'wlan',
                'name': u'Modena Travel Plaza',
                'operator': u'New York State Thruway Authority',
                'source': u'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 450420567,
                'kind': u'service_area',
                'min_zoom': 13,
            })
    def test_current_railway_halt(self):
        # Current railway halt
        import dsl

        z, x, y = (16, 35826, 22751)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/302735255
            dsl.point(
                302735255, (16.8020704, 48.1080027), {
                    'name': u'Wildungsmauer',
                    'network': u'VOR',
                    'operator': u'ÖBB-Infrastruktur AG',
                    'public_transport': u'stop_position',
                    'railway': u'halt',
                    'railway:platform_height': u'38',
                    'railway:platform_length': u'142',
                    'railway:position': u'38.0',
                    'railway:position:exact': u'37.985',
                    'railway:ref': u'Reg H1',
                    'ref': u'1',
                    'source': u'openstreetmap.org',
                    'train': u'yes',
                    'uic_name': u'Wildungsmauer',
                    'uic_ref': u'8101787',
                }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 302735255,
            'kind': u'halt',
            'min_zoom': 16,
        })
    def test_united_kingdom(self):
        # in the absence of data joined from NE, we should fall back to a
        # default based on the country that the label point is in.
        import dsl
        from tilequeue.tile import deg2num

        lon, lat = (-3.2765753, 54.7023545)
        z = 6
        x, y = deg2num(lat, lon, z)

        self.generate_fixtures(
            dsl.is_in('GB', z, x, y),
            # https://www.openstreetmap.org/node/838090640
            dsl.point(838090640, (lon, lat), {
                'name': u'United Kingdom',
                'place': u'country',
                'population': u'61792000',
                'source': u'openstreetmap.org',
                'wikidata': u'Q145',
                'wikipedia': u'de:United Kingdom',  # LOL, de:
            }),
        )

        self.assert_has_feature(
            z, x, y, 'places', {
                'id': 838090640,
                'min_zoom': 6,
                'max_zoom': 6.7,
            })
    def test_wales(self):
        # wales is a country within the UK, but mapped as place=state.
        # should get a fallback from the states_provinces spreadsheet.
        import dsl

        z, x, y = (10, 501, 336)

        self.generate_fixtures(
            dsl.is_in('GB', z, x, y),
            # https://www.openstreetmap.org/node/2642288017
            dsl.point(2642288017, (-3.73893, 52.2928116), {
                'is_in': u'United Kingdom, Europe',
                'name': u'Wales',
                'note': u'geographical centre of Wales',
                'place': u'state',
                'source': u'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'places', {
                'id': 2642288017,
                'min_zoom': 10,
                'max_zoom': 11,
            })
    def test_platform_bus_stop(self):
        import dsl

        z, x, y = (16, 10511, 25255)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/1866509704
            dsl.point(
                1866509704, (-122.259434, 38.100169), {
                    'bus': 'yes',
                    'covered': 'yes',
                    'highway': 'platform',
                    'local_ref': '85',
                    'network': 'SolTrans',
                    'operator': 'Soltrans',
                    'public_transport': 'platform',
                    'ref': 'Y',
                    'source': 'openstreetmap.org',
                    'wheelchair': 'yes',
                    'wifi': 'free for guests',
                }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 1866509704,
            'kind': 'bus_stop',
            'min_zoom': 18,
        })
    def turning_circle(self):
        self.generate_fixtures(
            dsl.point(106186562, (-0.3544854, 51.5785667),
                      {u'source': u'openstreetmap.org',
                       u'highway': u'turning_circle'}))

        self.assert_has_feature(
            16, 32703, 21771, 'pois',
            {'id': 106186562, 'kind': 'turning_circle', 'min_zoom': 17})
    def turning_loop(self):
        self.generate_fixtures(
            dsl.point(4260010359, (8.43452, 49.4596352),
                      {u'source': u'openstreetmap.org',
                       u'highway': u'turning_loop'}))

        self.assert_has_feature(
            16, 34303, 22378, 'pois',
            {'id': 4260010359, 'kind': 'turning_loop', 'min_zoom': 17})
예제 #25
0
    def turning_circle(self):
        self.generate_fixtures(
            dsl.point(106186562, (-0.3544854, 51.5785667), {
                u'source': u'openstreetmap.org',
                u'highway': u'turning_circle'
            }))

        self.assert_has_feature(16, 32703, 21771, 'pois', {
            'id': 106186562,
            'kind': 'turning_circle',
            'min_zoom': 17
        })
예제 #26
0
    def turning_loop(self):
        self.generate_fixtures(
            dsl.point(4260010359, (8.43452, 49.4596352), {
                u'source': u'openstreetmap.org',
                u'highway': u'turning_loop'
            }))

        self.assert_has_feature(16, 34303, 22378, 'pois', {
            'id': 4260010359,
            'kind': 'turning_loop',
            'min_zoom': 17
        })
    def test_amenity_bus_stop_unsupported(self):
        import dsl

        z, x, y = (16, 32768, 32768)

        self.generate_fixtures(
            dsl.point(1, (0, 0), {
                'amenity': 'bus_stop',
                'source': 'openstreetmap.org',
            }), )

        # should not produce any POI in the output
        self.assert_no_matching_feature(z, x, y, 'pois', {
            'kind': 'bus_stop',
        })
    def test_obelisk_node(self):
        import dsl

        z, x, y = (16, 18088, 25938)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/5370564611
            dsl.point(5370564611, (-80.634831, 35.088498), {
                'man_made': u'obelisk',
                'source': u'openstreetmap.org',
            }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 5370564611,
            'kind': u'obelisk',
        })
    def test_wayside_cross_node(self):
        import dsl

        z, x, y = (16, 19309, 24677)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/4987290359
            dsl.point(4987290359, (-73.927802, 40.559544), {
                'historic': u'wayside_cross',
                'source': u'openstreetmap.org',
            }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 4987290359,
            'kind': u'wayside_cross',
        })
    def test_elevator_node(self):
        import dsl

        z, x, y = (16, 19312, 24643)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/3017396520
            dsl.point(3017396520, (-73.911936, 40.699476), {
                'highway': u'elevator',
                'source': u'openstreetmap.org',
            }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 3017396520,
            'kind': u'elevator',
        })
    def test_amenity_bus_stop_unsupported(self):
        import dsl

        z, x, y = (16, 32768, 32768)

        self.generate_fixtures(
            dsl.point(1, (0, 0), {
                'amenity': 'bus_stop',
                'source': 'openstreetmap.org',
            }),
        )

        # should not produce any POI in the output
        self.assert_no_matching_feature(
            z, x, y, 'pois', {
                'kind': 'bus_stop',
            })
    def test_street_lamp(self):
        import dsl

        z, x, y = (16, 10483, 25330)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/5441990644
            dsl.point(5441990644, (-122.413513, 37.777848), {
                'highway': 'street_lamp',
                'source': 'openstreetmap.org',
            }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 5441990644,
            'kind': 'street_lamp',
            'min_zoom': 18,
        })
    def test_bicycle_parking(self):
        import dsl

        z, x, y = (16, 10478, 25330)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/3134706408
            dsl.point(3134706408, (-122.438528, 37.775930), {
                'amenity': 'bicycle_parking',
                'source': 'openstreetmap.org',
            }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 3134706408,
            'kind': 'bicycle_parking',
            'min_zoom': 19,
        })
    def test_car_sharing_no_name(self):
        import dsl

        z, x, y = (16, 10484, 25327)

        self.generate_fixtures(
            dsl.point(
                1409407264, (-122.404247, 37.792022), {
                    'amenity': 'car_sharing',
                    'operator': 'City CarShare',
                    'website': 'http://www.citycarshare.org/',
                }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 1409407264,
            'kind': 'car_sharing',
            'min_zoom': 19,
        })
    def test_wayside_cross_node(self):
        import dsl

        z, x, y = (16, 19309, 24677)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/4987290359
            dsl.point(4987290359, (-73.927802, 40.559544), {
                'historic': u'wayside_cross',
                'source': u'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 4987290359,
                'kind': u'wayside_cross',
            })
    def test_elevator_node(self):
        import dsl

        z, x, y = (16, 19312, 24643)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/3017396520
            dsl.point(3017396520, (-73.911936, 40.699476), {
                'highway': u'elevator',
                'source': u'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 3017396520,
                'kind': u'elevator',
            })
    def test_obelisk_node(self):
        import dsl

        z, x, y = (16, 18088, 25938)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/5370564611
            dsl.point(5370564611, (-80.634831, 35.088498), {
                'man_made': u'obelisk',
                'source': u'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 5370564611,
                'kind': u'obelisk',
            })
    def test_miniature_golf_node(self):
        import dsl

        z, x, y = (16, 19284, 24583)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/5181018838
            dsl.point(
                5181018838, (-74.068437, 40.948861), {
                    'leisure': u'miniature_golf',
                    'name': u'Monster Mini Golf',
                    'source': u'openstreetmap.org',
                }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 5181018838,
            'kind': u'miniature_golf',
        })
    def test_chemist_node(self):
        import dsl

        z, x, y = (16, 19298, 24631)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/663098951
            dsl.point(
                663098951, (-73.988039, 40.749678), {
                    'name': u'Lush',
                    'shop': u'chemist',
                    'source': u'openstreetmap.org',
                }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 663098951,
            'kind': u'chemist',
        })
    def test_stop(self):
        import dsl

        z, x, y = (16, 10578, 25372)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/53051770
            dsl.point(
                53051770, (-121.8890223, 37.5941573), {
                    'name': u'Sunol',
                    'railway': u'stop',
                    'source': u'openstreetmap.org',
                }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 53051770,
            'kind': u'stop',
            'min_zoom': 16,
        })
예제 #41
0
    def test_services(self):
        import dsl

        z, x, y = (13, 2380, 3110)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/3621020976
            dsl.point(
                3621020976, (-75.396490, 39.698151), {
                    'highway': u'services',
                    'name': u'Clara Barton Services',
                    'source': u'openstreetmap.org',
                }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 3621020976,
            'kind': u'service_area',
            'min_zoom': 13,
        })
    def test_plaque_node(self):
        import dsl

        z, x, y = (16, 19299, 24630)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/1289222425
            dsl.point(
                1289222425, (-73.982936, 40.752781), {
                    'historic': u'memorial',
                    'memorial': u'plaque',
                    'name': u'Wendell L. Willkie',
                    'source': u'openstreetmap.org',
                }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 1289222425,
            'kind': u'plaque',
        })
    def test_tram_stop(self):
        import dsl

        z, x, y = (16, 10482, 25324)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/2081705827
            dsl.point(
                2081705827, (-122.4196615, 37.8020638), {
                    'name': u'Hyde Street & Lombard Street',
                    'railway': u'tram_stop',
                    'source': u'openstreetmap.org',
                }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 2081705827,
            'kind': u'tram_stop',
            'min_zoom': 16,
        })
    def test_street_lamp(self):
        import dsl

        z, x, y = (16, 10483, 25330)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/5441990644
            dsl.point(5441990644, (-122.413513, 37.777848), {
                'highway': 'street_lamp',
                'source': 'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 5441990644,
                'kind': 'street_lamp',
                'min_zoom': 18,
            })
    def test_atm(self):
        import dsl

        z, x, y = (16, 10473, 25332)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/3161882181
            dsl.point(
                3161882181, (-122.466755, 37.769587), {
                    'amenity': 'atm',
                    'name': 'Wells Fargo',
                    'source': 'openstreetmap.org',
                }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 3161882181,
            'kind': 'atm',
            'min_zoom': 18,
        })
    def test_car_sharing_no_name(self):
        import dsl

        z, x, y = (16, 10484, 25327)

        self.generate_fixtures(
            dsl.point(1409407264, (-122.404247, 37.792022), {
                'amenity': 'car_sharing',
                'operator': 'City CarShare',
                'website': 'http://www.citycarshare.org/',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 1409407264,
                'kind': 'car_sharing',
                'min_zoom': 19,
            })
    def test_university_node(self):
        import dsl

        z, x, y = (16, 10484, 25327)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/4628353540
            dsl.point(
                4628353540, (-122.404460, 37.790842), {
                    'amenity': u'university',
                    'name': u'Academy of Arts University',
                    'source': u'openstreetmap.org',
                }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 4628353540,
            'kind': u'university',
            'min_zoom': 16,
        })
    def test_halt(self):
        import dsl

        z, x, y = (16, 10715, 25124)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/4560580421
            dsl.point(
                4560580421, (-121.138147, 38.6654377), {
                    'name': u'Oak Avenue Whistlestop',
                    'railway': u'halt',
                    'source': u'openstreetmap.org',
                }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 4560580421,
            'kind': u'halt',
            'min_zoom': 16,
        })
예제 #49
0
    def test_paediatrics(self):
        import dsl

        z, x, y = (16, 12098, 25485)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/4551720597
            dsl.point(4551720597, (-113.538890, 37.100048), {
                'healthcare': 'paediatrics',
                'name': 'Brain Blance Acheivement Centers',
                'source': 'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 4551720597,
                'kind': 'paediatrics',
            })
    def test_miniature_golf_node(self):
        import dsl

        z, x, y = (16, 19284, 24583)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/5181018838
            dsl.point(5181018838, (-74.068437, 40.948861), {
                'leisure': u'miniature_golf',
                'name': u'Monster Mini Golf',
                'source': u'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 5181018838,
                'kind': u'miniature_golf',
            })
    def test_bicycle_parking(self):
        import dsl

        z, x, y = (16, 10478, 25330)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/3134706408
            dsl.point(3134706408, (-122.438528, 37.775930), {
                'amenity': 'bicycle_parking',
                'source': 'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 3134706408,
                'kind': 'bicycle_parking',
                'min_zoom': 19,
            })
    def test_garden_node(self):
        import dsl

        z, x, y = (16, 10473, 25332)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/2969748430
            dsl.point(
                2969748430, (-122.469992, 37.767533), {
                    'leisure': u'garden',
                    'name': u'South Africa Garden',
                    'source': u'openstreetmap.org',
                }), )

        self.assert_has_feature(z, x, y, 'pois', {
            'id': 2969748430,
            'kind': u'garden',
            'min_zoom': 16,
        })
    def test_chemist_node(self):
        import dsl

        z, x, y = (16, 19298, 24631)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/663098951
            dsl.point(663098951, (-73.988039, 40.749678), {
                'name': u'Lush',
                'shop': u'chemist',
                'source': u'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 663098951,
                'kind': u'chemist',
            })
    def test_midwife(self):
        import dsl

        z, x, y = (16, 10572, 25430)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/4976744222
            dsl.point(4976744222, (-121.921157, 37.342539), {
                'healthcare': 'midwife',
                'name': 'South Bay Homebirth Collective',
                'source': 'openstreetmap.org',
                'website': 'https://www.southbayhomebirthcollective.com/',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 4976744222,
                'kind': 'midwife',
            })
    def test_plaque_node(self):
        import dsl

        z, x, y = (16, 19299, 24630)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/1289222425
            dsl.point(1289222425, (-73.982936, 40.752781), {
                'historic': u'memorial',
                'memorial': u'plaque',
                'name': u'Wendell L. Willkie',
                'source': u'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 1289222425,
                'kind': u'plaque',
            })
    def test_stop(self):
        import dsl

        z, x, y = (16, 10578, 25372)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/53051770
            dsl.point(53051770, (-121.8890223, 37.5941573), {
                'name': u'Sunol',
                'railway': u'stop',
                'source': u'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 53051770,
                'kind': u'stop',
                'min_zoom': 16,
            })
    def test_halt(self):
        import dsl

        z, x, y = (16, 10715, 25124)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/4560580421
            dsl.point(4560580421, (-121.138147, 38.6654377), {
                'name': u'Oak Avenue Whistlestop',
                'railway': u'halt',
                'source': u'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 4560580421,
                'kind': u'halt',
                'min_zoom': 16,
            })
    def test_tram_stop(self):
        import dsl

        z, x, y = (16, 10482, 25324)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/2081705827
            dsl.point(2081705827, (-122.4196615, 37.8020638), {
                'name': u'Hyde Street & Lombard Street',
                'railway': u'tram_stop',
                'source': u'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 2081705827,
                'kind': u'tram_stop',
                'min_zoom': 16,
            })