Ejemplo n.º 1
0
    def test_baker_beach(self):
        # Baker beach, SF
        self.generate_fixtures(
            dsl.way(
                421294972,
                wkt_loads(
                    'LINESTRING (-122.482596828622 37.79668561982258, -122.482667705698 37.79642851526459, -122.482782869717 37.7961342139185, -122.482960915806 37.79570837639309, -122.483016701186 37.79553041689338, -122.483153963761 37.79519068129307, -122.483237776577 37.79495571906769, -122.483405312377 37.79458929008149, -122.483541317311 37.79434509772937, -122.483694300404 37.79409245717608, -122.483770836867 37.793914493784, -122.483874412619 37.79369975876519, -122.48394322357 37.79337847141948, -122.484271827301 37.79285756554681, -122.484593783498 37.7926045649672, -122.48492418386 37.79207797456289, -122.485115345352 37.79161470252219, -122.485207243006 37.79148209515751, -122.485431731995 37.79130057601818, -122.48568999764 37.79107376520379, -122.485874960757 37.79081791892991, -122.485958683741 37.7907306016026, -122.486191437231 37.7905165672297, -122.4867056329 37.7901570732759, -122.48692428284 37.7899069740611, -122.487385028749 37.7896697943189, -122.487539718641 37.78954286273439, -122.487612931337 37.7894718718203)'
                ), {
                    u'source': u'openstreetmap.org',
                    u'area': u'yes'
                }),
            dsl.way(
                -6260732,
                wkt_loads(
                    'POLYGON ((-122.487612931337 37.7894718718203, -122.487539718641 37.78954286273439, -122.487385028749 37.7896697943189, -122.48692428284 37.7899069740611, -122.4867056329 37.7901570732759, -122.486191437231 37.7905165672297, -122.485958683741 37.7907306016026, -122.485874960757 37.79081791892991, -122.48568999764 37.79107376520379, -122.485431731995 37.79130057601818, -122.485207243006 37.79148209515751, -122.485115345352 37.79161470252219, -122.48492418386 37.79207797456289, -122.484593783498 37.7926045649672, -122.484271827301 37.79285756554681, -122.48394322357 37.79337847141948, -122.483874412619 37.79369975876519, -122.483770836867 37.793914493784, -122.483694300404 37.79409245717608, -122.483541317311 37.79434509772937, -122.483405312377 37.79458929008149, -122.483237776577 37.79495571906769, -122.483153963761 37.79519068129307, -122.483016701186 37.79553041689338, -122.482960915806 37.79570837639309, -122.482782869717 37.7961342139185, -122.482667705698 37.79642851526459, -122.482596828622 37.79668561982258, -122.481988759006 37.79651916211449, -122.482090807622 37.79631039735438, -122.482167613579 37.79621329066167, -122.482207678441 37.7961161838414, -122.482230315986 37.79601510175238, -122.482332005276 37.79576282183449, -122.482384646552 37.79563348722628, -122.482432436925 37.79549769274237, -122.482509063219 37.795308871979, -122.48252559222 37.7952368218236, -122.482599523568 37.7951121713396, -122.482681719416 37.79491596707651, -122.482708489212 37.79482056221029, -122.482714777419 37.79475759777058, -122.482772808586 37.7946781645396, -122.482826707503 37.79458872219328, -122.482873060572 37.79447897770611, -122.48303520648 37.79413895332489, -122.483195106601 37.79381085315859, -122.483277302449 37.79361556827009, -122.483354827059 37.7934797700772, -122.483484004796 37.79325850296267, -122.48365818813 37.79295985874508, -122.483878365206 37.792589018607, -122.484022993967 37.79234531656098, -122.484159088732 37.79211836697678, -122.48428296641 37.79187835478749, -122.484327792343 37.79179160662309, -122.484409179707 37.79158907552859, -122.484457778564 37.79149842262959, -122.484660258829 37.79118805806431, -122.485265902994 37.7905984895803, -122.485277221767 37.79055348199169, -122.485142743968 37.79039666511599, -122.485196193728 37.79023920899569, -122.485229341562 37.79022579184458, -122.485267340298 37.79022749561, -122.485373431333 37.79031836303861, -122.48545670516 37.7903388791848, -122.485572408169 37.79034981166168, -122.485671043187 37.79032496512088, -122.485720091202 37.7903354716592, -122.485955270143 37.79015118108159, -122.486054533982 37.7900383064253, -122.486177693007 37.78993075588488, -122.48641763302 37.78975185958969, -122.486485006666 37.78972225647049, -122.486539983561 37.78967320187528, -122.48654869722 37.78962819372299, -122.486796003417 37.7894987773848, -122.486849812503 37.78949728657538, -122.486922216715 37.7894750664129, -122.486968839278 37.7894240948967, -122.487039806185 37.78936751505268, -122.4871452684 37.7893719164975, -122.487397694995 37.78940102281999, -122.487505941986 37.78940797993918, -122.487612931337 37.7894718718203))'
                ), {
                    u'natural': u'beach',
                    u'name': u'Baker Beach',
                    u'way_area': u'77991.2',
                    u'surface': u'sand',
                    u'source': u'openstreetmap.org',
                    u'nudism': u'no'
                }))  # noqa

        self.assert_has_feature(16, 10470, 25327, 'landuse', {'kind': 'beach'})
    def test_historic_railway_halt(self):
        # Historic railway halt
        self.generate_fixtures(
            dsl.way(
                708144563,
                wkt_loads('POINT (14.8139903286339 59.15514209522067)'), {
                    u'historic:railway': u'halt',
                    u'historic': u'yes',
                    u'disused': u'yes',
                    u'name': u'Kvistbro',
                    u'source': u'openstreetmap.org'
                }))  # noqa

        self.assert_no_matching_feature(13, 4433, 2416, 'pois',
                                        {'id': 708144563})

        self.generate_fixtures(
            dsl.way(
                2468597590,
                wkt_loads('POINT (9.147960458165631 46.24711157299198)'), {
                    u'source': u'openstreetmap.org',
                    u'railway': u'halt',
                    u'historic': u'railway_station',
                    u'name': u'Grono'
                }))  # noqa

        self.assert_no_matching_feature(13, 4304, 2906, 'pois',
                                        {'id': 2468597590})
    def test_remain_z13_track_road_no_grade1(self):

        # gravel, track (no grade so default track at zoom 13)
        self.generate_fixtures(
            dsl.way(
                84341859,
                wkt_loads('POINT (-111.363730570973 38.4694190199655)'), {
                    u'source': u'openstreetmap.org',
                    u'junction': u'yes',
                    u'name': u'Hartnet Junction'
                }),
            dsl.way(
                313839575,
                wkt_loads(
                    'LINESTRING (-111.363730570973 38.4694190199655, -111.364292197688 38.4691876952643, -111.364809896787 38.4689273925468, -111.365262827353 38.46874551065229, -111.366068705994 38.46865337386408, -111.367365873265 38.4681697592953, -111.368592432953 38.46775295914589, -111.369971885904 38.46766307179148, -111.370774889936 38.46761250131359, -111.372480790661 38.4670252059618, -111.373172044272 38.4669491737229, -111.373986816235 38.46679485827548, -111.374616175923 38.4667234679272, -111.375072070929 38.46671657506218, -111.375519162446 38.46660839919728, -111.375901575263 38.46641947788927, -111.376275094758 38.4664171568128, -111.376642775204 38.466470189875, -111.37706633086 38.46658075735399, -111.377507493496 38.46677882182899, -111.377845799032 38.4670252059618, -111.379242230141 38.467697465323, -111.380042988386 38.46816145988961, -111.380363327616 38.4683992585853, -111.380706394223 38.46869726193669, -111.38103302166 38.46884545431779, -111.38154667834 38.4691125093016, -111.382050004393 38.4693356053063, -111.382432686704 38.4694968079167, -111.382807104515 38.4696710920089, -111.383089894166 38.46974269043637, -111.384034203193 38.4698143591251, -111.384404398921 38.46980296528539, -111.384672725697 38.4697329142309, -111.385080291341 38.46951150743869, -111.385768670343 38.46908972139848, -111.386209743148 38.46877061966499, -111.386444742426 38.46864359751091, -111.386783676783 38.46854590424021, -111.387106082138 38.4684855580068, -111.387436841826 38.4685262811698, -111.387883933343 38.46846438757959, -111.388391391647 38.4683569880079, -111.388613904343 38.46835860568429, -111.388848993453 38.46838631717989, -111.389000808736 38.46832758849008, -111.389102677689 38.46821850070111, -111.389312793634 38.46808831254361, -111.38959351716 38.46795798348261, -111.389782792191 38.46791240693948, -111.390061539423 38.46792218339179, -111.390232039664 38.46799216587111, -111.390367236114 38.46815991254259, -111.390602774382 38.46827659647519, -111.391287021134 38.46851108911168, -111.391829783228 38.46866737022349, -111.392110596586 38.46880262133529, -111.392193780582 38.46893766119379, -111.392324844782 38.46912826389708, -111.392408028777 38.46920970947419, -111.392811462171 38.4693740773407, -111.393244090812 38.46947669277639, -111.39336680068 38.46952226833089, -111.393699626492 38.46974051013169, -111.394015743641 38.46985775416509, -111.394587700982 38.46996690980639, -111.394743738347 38.46996845711458, -111.394878934797 38.46992618745698, -111.395080606579 38.46985128359348, -111.395226223486 38.46983327852179, -111.395413432391 38.4698903180109, -111.395658762296 38.46997661564801, -111.395850193283 38.46993589330399, -111.396103877519 38.4698903180109, -111.39638666717 38.46988061215779, -111.396684189192 38.4698854650845, -111.396890083055 38.46993097004839, -111.397016925174 38.47002057324739, -111.397116817833 38.4701378168254, -111.397189581371 38.4702599834462, -111.397264411034 38.47043419536209, -111.397480725355 38.4706963915903, -111.397807262961 38.4708966953625, -111.398408325717 38.471152278792, -111.398766124695 38.47120931723779, -111.399365121326 38.47120277645658, -111.399572991483 38.4712076996253, -111.399647910978 38.47125819725098, -111.399666595936 38.47136066934379, -111.39957927969 38.47146011706949, -111.399437795033 38.47167181226649, -111.399460702072 38.47183300965409, -111.39960218673 38.47189651794997, -111.399785173553 38.4719468744328, -111.399955673794 38.4720577148353, -111.400246907609 38.47228888966949, -111.400831261701 38.47256901321691, -111.401326323255 38.4729841679564, -111.401561322533 38.47313720423519, -111.402083423376 38.47336190535189, -111.402805129875 38.47366811663829, -111.403543365376 38.47400506007638, -111.403755637277 38.47412067962839, -111.403909518686 38.47415331187711, -111.404065466219 38.47411575665849, -111.404269293957 38.47407510698039, -111.40454804119 38.47405070309679, -111.404855804006 38.47404261535259, -111.405107511948 38.4739952844488, -111.405307117605 38.47401652358041, -111.405483906053 38.4740799596248, -111.405639943417 38.47409297033659, -111.405802089326 38.47402629920499, -111.405999718689 38.47389436332419, -111.406068260145 38.47372986510479, -111.406124494682 38.4735427206716, -111.406245138424 38.4734157069238, -111.406334520795 38.47336675804429, -111.406432347329 38.4732545130746, -111.406428125248 38.47313720423519, -111.40632832242 38.47310625942558, -111.4061202726 38.4730997891456, -111.405989298231 38.47306715641999, -111.405987232106 38.47300695462881, -111.406105809724 38.4729694691423, -111.406282598172 38.4729532230812, -111.406448876331 38.47290441454639, -111.406821228016 38.47274476680258, -111.407106173624 38.47268287683328, -111.407520027475 38.47263730327648, -111.407838300581 38.47261128132529, -111.408013022903 38.47265530764809, -111.408152261772 38.47278548756029, -111.408322941676 38.4729955612935, -111.40854123229 38.47319909381451, -111.409056416106 38.47351726167688, -111.409222784097 38.47354897992579, -111.409498387226 38.47353927456509, -111.409975662136 38.47352626375339, -111.410514202149 38.47351585510238, -111.410930211957 38.47349792127439, -111.41126303777 38.47351261998079, -111.411770496074 38.47357450923788, -111.411988786688 38.4735956078361, -111.412194680551 38.47357936191599, -111.412999571046 38.47352556046618, -111.41323259403 38.47353540648619, -111.413355303898 38.4736037659591, -111.41341773681 38.47369167670858)'
                ), {
                    u'source': u'openstreetmap.org',
                    u'name': u'Thousand Lake Mountain Road',
                    u'smoothness': u'very_bad',
                    u'surface': u'gravel',
                    u'highway': u'track'
                }))  # noqa

        self.assert_has_feature(13, 1561, 3146, 'roads', {
            'kind': 'path',
            'kind_detail': 'track'
        })
Ejemplo n.º 4
0
    def test_centre(self):
        # Way: Grant Avenue (184956229)
        self.generate_fixtures(
            dsl.way(
                65328690,
                wkt_loads('POINT (-122.405056678748 37.78776849537549)'), {
                    u'source': u'openstreetmap.org',
                    u'turn_restrictions': u'no',
                    u'highway': u'traffic_signals'
                }),
            dsl.way(
                184956229,
                wkt_loads(
                    'LINESTRING (-122.405056678748 37.78776849537549, -122.405140671227 37.7881806771727)'
                ), {
                    u'bicycle': u'yes',
                    u'lanes': u'2',
                    u'name': u'Grant Avenue',
                    u'tiger:cfcc': u'A41',
                    u'surface': u'paved',
                    u'cycleway': u'no',
                    u'source': u'openstreetmap.org',
                    u'tiger:county': u'San Francisco, CA',
                    u'tiger:name_type': u'Ave',
                    u'oneway': u'no',
                    u'turn:lanes:backward': u'right',
                    u'lanes:backward': u'1',
                    u'sidewalk': u'both',
                    u'lanes:forward': u'1',
                    u'highway': u'secondary'
                }))  # noqa

        self.assert_no_matching_feature(16, 10484, 25327, 'roads',
                                        {'cycleway': 'no'})
    def test_funicular(self):
        self.generate_fixtures(
            dsl.way(
                54834749,
                wkt_loads(
                    'LINESTRING (-80.01764782181549 40.439810883179, -80.0187104389651 40.43836799398048)'
                ), {
                    u'website': u'http://www.duquesneincline.org',
                    u'name': u'Dusquesne Incline',
                    u'wikipedia': u'en:Duquesne Incline',
                    u'source': u'openstreetmap.org',
                    u'historic': u'yes',
                    u'gauge': u'1524',
                    u'heritage': u'2',
                    u'wikidata': u'Q1266663',
                    u'railway': u'funicular',
                    u'ref:nrhp': u'75001609',
                    u'heritage:operator': u'nrhp',
                    u'incline': u'up'
                }),
            dsl.way(
                -6060405,
                wkt_loads(
                    'LINESTRING (-80.01764782181549 40.439810883179, -80.0187104389651 40.43836799398048)'
                ), {
                    u'route_pref_color': u'0',
                    u'source': u'openstreetmap.org',
                    u'route': u'funicular',
                    u'route_name': u'Dusquesne Incline',
                    u'name': u'Dusquesne Incline'
                }))  # noqa

        self.assert_has_feature(16, 18201, 24705, 'transit',
                                {'kind': 'funicular'})
    def test_residential(self):
        self.generate_fixtures(
            dsl.way(65325902,
                    wkt_loads('POINT (-122.400231557862 37.71432265607909)'), {
                        u'source': u'openstreetmap.org',
                        u'highway': u'turning_circle'
                    }),
            dsl.way(
                8919312,
                wkt_loads(
                    'LINESTRING (-122.400231557862 37.71432265607909, -122.400242337646 37.7142653792107, -122.400258417489 37.71422721829488, -122.400291924649 37.71417939276188, -122.401426946011 37.71302595662628, -122.401543906661 37.7129330044265, -122.401691859188 37.71285597055789, -122.401931889032 37.7127569776553, -122.402171290055 37.7126810095736)'
                ), {
                    u'name': u'Racine Lane',
                    u'tiger:reviewed': u'no',
                    u'source': u'openstreetmap.org',
                    u'tiger:county': u'San Francisco, CA',
                    u'tiger:name_type': u'Ln',
                    u'highway': u'residential'
                }))  # noqa

        self.assert_has_feature(
            16, 10485, 25344, "roads", {
                "kind": "minor_road",
                "kind_detail": "residential",
                "id": 8919312,
                "name": "Racine Ln.",
                "sort_rank": 360
            })
Ejemplo n.º 7
0
    def test_zephyr(self):
        self.generate_fixtures(
            dsl.way(
                93422625,
                wkt_loads(
                    'LINESTRING (-122.413568934717 37.8082184864869, -122.413249403971 37.8082546826744, -122.413185264259 37.80790187554879, -122.41316181823 37.80790457253178, -122.413155799518 37.80787156996978, -122.413487008363 37.80783409607501, -122.413491589771 37.80785936256678, -122.413479282852 37.80786078203229, -122.413536864861 37.80817767703849, -122.413561029543 37.80817498006539, -122.413568934717 37.8082184864869)'
                ), {
                    u'source': u'openstreetmap.org',
                    u'inner': u'yes'
                }),
            dsl.way(
                -1358120,
                wkt_loads(
                    'POLYGON ((-122.41402869248 37.80835035408079, -122.412694604451 37.80850741673659, -122.412676188988 37.80850862327168, -122.412662175269 37.80850628117408, -122.41264519711 37.80849996460729, -122.41263280036 37.80849137691451, -122.412622918891 37.80847789210557, -122.412619864619 37.80846398145799, -122.412478110468 37.8077707878611, -122.41388532136 37.80760712310128, -122.41402869248 37.80835035408079), (-122.413568934717 37.8082184864869, -122.413561029543 37.80817498006539, -122.413536864861 37.80817767703849, -122.413479282852 37.80786078203229, -122.413491589771 37.80785936256678, -122.413487008363 37.80783409607501, -122.413155799518 37.80787156996978, -122.41316181823 37.80790457253178, -122.413185264259 37.80790187554879, -122.413249403971 37.8082546826744, -122.413568934717 37.8082184864869))'
                ), {
                    u'building': u'yes',
                    u'addr:housenumber': u'250',
                    u'name': u'Hotel Zephyr',
                    u'way_area': u'14876.5',
                    u'source': u'openstreetmap.org',
                    u'tourism': u'hotel',
                    u'addr:street': u'Beach Street'
                }))  # noqa

        self.assert_has_feature(16, 10483, 25323, 'pois', {
            'kind': 'hotel',
            'name': 'Hotel Zephyr'
        })
Ejemplo n.º 8
0
def guess_coordinates_by_postcode_opsd(df):
    # *** Use postcode ***
    if 'postcode' in df:
        df_pstc = df.loc[(df.lon.isnull() & df.postcode.notnull())]
        if len(df_pstc) > 0:
            pstc = pd.read_csv(
                os.path.join(cfg.get('paths', 'geometry'),
                             cfg.get('geometry', 'postcode_polygon')),
                index_col='zip_code')
        for idx, val in df_pstc.iterrows():
            try:
                # If the postcode is not number the integer conversion will
                # raise a ValueError. Some postcode look like this '123XX'.
                # It would be possible to add the mayor regions to the postcode
                # map in order to search for the first two/three digits.
                postcode = int(val.postcode)
                if postcode in pstc.index:
                    df.loc[df.id == val.id, 'lon'] = wkt_loads(
                        pstc.loc[postcode].values[0]).centroid.x
                    df.loc[df.id == val.id, 'lat'] = wkt_loads(
                        pstc.loc[postcode].values[0]).centroid.y
                # Replace the last number with a zero and try again.
                elif round(postcode / 10) * 10 in pstc.index:
                    postcode = round(postcode / 10) * 10
                    df.loc[df.id == val.id, 'lon'] = wkt_loads(
                        pstc.loc[postcode].values[0]).centroid.x
                    df.loc[df.id == val.id, 'lat'] = wkt_loads(
                        pstc.loc[postcode].values[0]).centroid.y
                else:
                    logging.debug("Cannot find postcode {0}.".format(postcode))
            except ValueError:
                logging.debug("Cannot find postcode {0}.".format(val.postcode))
    return df
Ejemplo n.º 9
0
    def test_yard(self):
        self.generate_fixtures(
            dsl.way(1344032371,
                    wkt_loads('POINT (-122.401192216227 37.7716789726811)'), {
                        u'source': u'openstreetmap.org',
                        u'railway': u'buffer_stop'
                    }),
            dsl.way(
                119709585,
                wkt_loads(
                    'LINESTRING (-122.399873579222 37.772668676103, -122.400049469354 37.77256117129298, -122.400127802447 37.77251331243039, -122.400226886623 37.7724467076115, -122.400287522904 37.7724011919172, -122.401192216227 37.7716789726811)'
                ), {
                    u'service': u'yard',
                    u'electrified': u'no',
                    u'source': u'openstreetmap.org',
                    u'gauge': u'1435',
                    u'railway': u'rail',
                    u'railway:traffic_mode': u'passenger'
                }))  # noqa

        self.assert_has_feature(
            16, 10485, 25331, "roads", {
                "kind": "rail",
                "kind_detail": "rail",
                "service": "yard",
                "id": 119709585,
                "sort_rank": 359
            })
    def test_steps(self):
        self.generate_fixtures(
            dsl.way(1257335719,
                    wkt_loads('POINT (-117.92093753265 33.81130848987728)'), {
                        u'source': u'openstreetmap.org',
                        u'barrier': u'gate'
                    }),
            dsl.way(
                109938341,
                wkt_loads(
                    'LINESTRING (-117.920943461531 33.81131625230589, -117.92093753265 33.81130848987728, -117.920926124046 33.8113000556992, -117.920905911952 33.81129169615908, -117.92087114715 33.81128169456529, -117.920854618149 33.8112802764288)'
                ), {
                    u'bridge': u'yes',
                    u'name': u'Privet Enterance',
                    u'highway': u'steps',
                    u'source': u'openstreetmap.org'
                }))  # noqa

        self.assert_has_feature(
            16, 11301, 26220, "roads", {
                "kind": "path",
                "kind_detail": "steps",
                "id": 109938341,
                "sort_rank": 404
            })
Ejemplo n.º 11
0
    def test_man_made_offshore_platform(self):
        self.generate_fixtures(
            dsl.way(
                4239915448,
                wkt_loads('POINT (-97.05473509633438 26.12074297830959)'), {
                    u'seamark:type': u'platform',
                    u'man_made': u'offshore_platform',
                    u'source': u'openstreetmap.org'
                }))  # noqa

        self.assert_has_feature(15, 7549, 13919, 'pois', {'id': 4239915448})

        # originally from 675-man_made-outdoor-landmarks.py
        self.generate_fixtures(
            dsl.way(
                350328482,
                wkt_loads(
                    'POLYGON ((-94.63139900237969 29.40923572279329, -94.63116238613378 29.40925700824868, -94.6311144160976 29.4088532881355, -94.6313510323435 29.40883200259559, -94.63139900237969 29.40923572279329))'
                ), {
                    u'source': u'openstreetmap.org',
                    u'way_area': u'1373.41',
                    u'man_made': u'offshore_platform',
                    u'area': u'yes'
                }))  # noqa

        self.assert_has_feature(13, 1942, 3395, 'pois', {'id': 350328482})
Ejemplo n.º 12
0
    def test_light_rail(self):
        self.generate_fixtures(
            dsl.way(1718992959,
                    wkt_loads('POINT (-122.438462688545 37.72991545355039)'), {
                        u'source': u'openstreetmap.org',
                        u'railway': u'level_crossing'
                    }),
            dsl.way(
                160279679,
                wkt_loads(
                    'LINESTRING (-122.438552070915 37.72986067542419, -122.438462688545 37.72991545355039, -122.438370341733 37.7299662529438, -122.438270179579 37.73001499190951, -122.438149266342 37.7300662885706, -122.438038863393 37.73010550704638, -122.437906002563 37.73014365978288, -122.437775836678 37.7301752050474, -122.437444717665 37.73024952109041, -122.436208815497 37.7305180813121, -122.436088980238 37.7305490580369, -122.435969414473 37.73058820520968, -122.435851914834 37.73064440374629, -122.435736301657 37.73071246715069, -122.435653117662 37.73078081468179, -122.4355848457 37.73085122251937, -122.435517382222 37.7309300138548, -122.435446594978 37.73103168226189, -122.435389012968 37.73113157435541)'
                ), {
                    u'name': u'Muni J',
                    u'electrified': u'contact_line',
                    u'source': u'openstreetmap.org',
                    u'frequency': u'0',
                    u'gauge': u'1435',
                    u'voltage': u'600',
                    u'oneway': u'yes',
                    u'railway': u'light_rail'
                }))  # noqa

        self.assert_has_feature(
            16, 10478, 25341, "roads", {
                "kind": "rail",
                "kind_detail": "light_rail",
                "id": 160279679,
                "sort_rank": 382
            })
Ejemplo n.º 13
0
    def test_spur(self):
        # spurs, sidings, etc...
        self.generate_fixtures(
            dsl.way(1487041071,
                    wkt_loads('POINT (-106.648475890418 35.07718587778591)'), {
                        u'source': u'openstreetmap.org',
                        u'railway': u'switch'
                    }),
            dsl.way(
                135403703,
                wkt_loads(
                    'LINESTRING (-106.649071024293 35.07403947074057, -106.648987570803 35.07451947511569, -106.648884803535 35.07504616069249, -106.648804943306 35.07547976946611, -106.648697414967 35.076037399607, -106.64857946617 35.07661737502089, -106.648547396314 35.07681278221138, -106.648503289034 35.0770306849374, -106.648475890418 35.07718587778591)'
                ), {
                    u'source': u'openstreetmap.org',
                    u'railway': u'rail',
                    u'service': u'spur'
                }))  # noqa

        self.assert_has_feature(
            16, 13353, 25941, "roads", {
                "kind": "rail",
                "kind_detail": "rail",
                "service": "spur",
                "id": 135403703,
                "sort_rank": 361
            })
Ejemplo n.º 14
0
    def test_rikers_island(self):
        self.generate_fixtures(
            dsl.way(
                113738569,
                wkt_loads(
                    'LINESTRING (-73.88619559241629 40.78670926170489, -73.88598960872169 40.7867636061766, -73.88581210162148 40.78669477437268, -73.88544783477379 40.78668321171088, -73.88529018044149 40.78672259276838, -73.88495340204139 40.78655996721398, -73.883889617082 40.78629157636468, -73.88361302580599 40.78626858693091, -73.88341225233998 40.78631579007937, -73.8833307751437 40.78649045504029, -73.88328738651551 40.78648215710478, -73.88328738651551 40.78631789857658, -73.8829500691263 40.7861866955101, -73.88169287688619 40.78589680995149, -73.88157798236141 40.78593775585329, -73.88141251268598 40.7858288614642, -73.88110654650029 40.78573180179259, -73.8807860276069 40.78578771144548, -73.8794390936699 40.78556169196288, -73.87916142441559 40.7854651760361, -73.87862306406581 40.78537117659838, -73.87804203374 40.78545470143099, -73.87782455160971 40.78556720132448, -73.8766314990809 40.78586048914709, -73.876209740055 40.78582926956337, -73.8760088767575 40.78590007474199, -73.87512152091979 40.78593816395188, -73.8743435798838 40.78582457642207, -73.8736586144796 40.7858032192241, -73.87312357789638 40.78588232244199, -73.8729069042499 40.7859578206963, -73.87267298294989 40.78618309065278, -73.8723882170048 40.7863659178819, -73.87206850659518 40.78650956749447, -73.87172292470538 40.78674721441948, -73.8715374225992 40.78687011849157, -73.8714113889649 40.78732058343628, -73.87127897729199 40.787511977401, -73.8711282399873 40.78760957858857, -73.870890006774 40.7879340760004, -73.8709898994336 40.7884577846806, -73.87103867795351 40.78882471836661, -73.8710150522615 40.78898216936368, -73.8710622138139 40.78919987960899, -73.8710590697104 40.78938970386069, -73.8712609211548 40.7899572690156, -73.8713451831284 40.79014348645999, -73.871699388845 40.79054836137328, -73.8720644641764 40.7908744086858, -73.8728886684496 40.79141836140191, -73.87358504245789 40.79172175694869, -73.8738783423981 40.79182479278079, -73.8741893391495 40.7918462160525, -73.87428527922179 40.79181336703301, -73.87487690966789 40.79212498999629, -73.87526866496339 40.79240519097548, -73.87530989763491 40.79251611487138, -73.8755793023886 40.79288717469921, -73.87592048253349 40.79315438273728, -73.87630505130659 40.79332576528559, -73.8769245295266 40.79370158118189, -73.87768118049038 40.79410786256829, -73.8780131079879 40.79429651665539, -73.87850394745909 40.79447836943888, -73.8791124662326 40.79465369300449, -73.87945247856759 40.79470408654268, -73.87967651839951 40.79481038209889, -73.87984216773791 40.7947959645414, -73.8799593978824 40.7948418014822, -73.8804840140084 40.79485628703697, -73.88151429180769 40.79501800818069, -73.88172665354088 40.7950254209571, -73.88205364030431 40.79509771248509, -73.8826248789935 40.79517381232468, -73.8830125918701 40.79532118325839, -73.88324552502328 40.79548997596088, -73.883586166179 40.79585428654799, -73.88368004012619 40.79587781671319, -73.8837236084175 40.79585727882378, -73.88357673386849 40.79560347895109, -73.88365183302629 40.79557491620369, -73.8838148772504 40.79563476194608)'
                ), {
                    u'source': u'openstreetmap.org',
                    u'area': u'yes'
                }),
            dsl.way(
                -3955540,
                wkt_loads(
                    'POLYGON ((-73.892691849225 40.79306338658551, -73.89258018863518 40.79354427739299, -73.89255449681798 40.7938367138842, -73.89243430223299 40.7939277089761, -73.8924429260597 40.7939666776881, -73.8923999865892 40.7945450169311, -73.89222831853839 40.79494775678188, -73.89221125054799 40.79525317640758, -73.89212528177529 40.79569508367947, -73.8919107640854 40.79654631474289, -73.89165330692499 40.79691667199458, -73.8910352660095 40.7974690077811, -73.89073486937851 40.79770709151379, -73.890674772086 40.79775476256129, -73.8906644414602 40.79775945485938, -73.89063093430009 40.79777448381198, -73.8902113312309 40.7979627874593, -73.8901255421213 40.79784582028729, -73.8895247488593 40.79780025743779, -73.8890439705192 40.79783276347388, -73.8886577847786 40.79806016927321, -73.8883882003618 40.7982225626507, -73.88825453104748 40.79830321516039, -73.88823719356249 40.79831361973499, -73.8878939472925 40.79837856328498, -73.88742179277918 40.79834605751611, -73.8869154124535 40.79815768695209, -73.88628883754281 40.79775476256129, -73.88537902382311 40.79710511408508, -73.8844692101033 40.79632536430771, -73.88407440053589 40.79598098210779, -73.8838148772504 40.79563476194608, -73.88365183302629 40.79557491620369, -73.88357673386849 40.79560347895109, -73.8837236084175 40.79585727882378, -73.88368004012619 40.79587781671319, -73.883586166179 40.79585428654799, -73.88324552502328 40.79548997596088, -73.8830125918701 40.79532118325839, -73.8826248789935 40.79517381232468, -73.88205364030431 40.79509771248509, -73.88172665354088 40.7950254209571, -73.88151429180769 40.79501800818069, -73.8804840140084 40.79485628703697, -73.8799593978824 40.7948418014822, -73.87984216773791 40.7947959645414, -73.87967651839951 40.79481038209889, -73.87945247856759 40.79470408654268, -73.8791124662326 40.79465369300449, -73.87850394745909 40.79447836943888, -73.8780131079879 40.79429651665539, -73.87768118049038 40.79410786256829, -73.8769245295266 40.79370158118189, -73.87630505130659 40.79332576528559, -73.87592048253349 40.79315438273728, -73.8755793023886 40.79288717469921, -73.87530989763491 40.79251611487138, -73.87526866496339 40.79240519097548, -73.87487690966789 40.79212498999629, -73.87428527922179 40.79181336703301, -73.8741893391495 40.7918462160525, -73.8738783423981 40.79182479278079, -73.87358504245789 40.79172175694869, -73.8728886684496 40.79141836140191, -73.8720644641764 40.7908744086858, -73.871699388845 40.79054836137328, -73.8713451831284 40.79014348645999, -73.8712609211548 40.7899572690156, -73.8710590697104 40.78938970386069, -73.8710622138139 40.78919987960899, -73.8710150522615 40.78898216936368, -73.87103867795351 40.78882471836661, -73.8709898994336 40.7884577846806, -73.870890006774 40.7879340760004, -73.8711282399873 40.78760957858857, -73.87127897729199 40.787511977401, -73.8714113889649 40.78732058343628, -73.8715374225992 40.78687011849157, -73.87172292470538 40.78674721441948, -73.87206850659518 40.78650956749447, -73.8723882170048 40.7863659178819, -73.87267298294989 40.78618309065278, -73.8729069042499 40.7859578206963, -73.87312357789638 40.78588232244199, -73.8736586144796 40.7858032192241, -73.8743435798838 40.78582457642207, -73.87512152091979 40.78593816395188, -73.8760088767575 40.78590007474199, -73.876209740055 40.78582926956337, -73.8766314990809 40.78586048914709, -73.87782455160971 40.78556720132448, -73.87804203374 40.78545470143099, -73.87862306406581 40.78537117659838, -73.87916142441559 40.7854651760361, -73.8794390936699 40.78556169196288, -73.8807860276069 40.78578771144548, -73.88110654650029 40.78573180179259, -73.88141251268598 40.7858288614642, -73.88157798236141 40.78593775585329, -73.88169287688619 40.78589680995149, -73.8829500691263 40.7861866955101, -73.88328738651551 40.78631789857658, -73.88328738651551 40.78648215710478, -73.8833307751437 40.78649045504029, -73.88341225233998 40.78631579007937, -73.88361302580599 40.78626858693091, -73.883889617082 40.78629157636468, -73.88495340204139 40.78655996721398, -73.88529018044149 40.78672259276838, -73.88544783477379 40.78668321171088, -73.88581210162148 40.78669477437268, -73.88598960872169 40.7867636061766, -73.88619559241629 40.78670926170489, -73.8869056208169 40.78672558545581, -73.8878939472925 40.7868835175382, -73.8886406269566 40.78713048120878, -73.88915563110901 40.78744239820899, -73.88965338760802 40.7882676857086, -73.88986799512941 40.7890150877971, -73.8902113312309 40.78992475912329, -73.8906146747935 40.7901717794957, -73.89094094290471 40.7901717794957, -73.89145576739399 40.79018476980371, -73.89205674031911 40.79024972130569, -73.89221125054799 40.79060059434208, -73.89230557365281 40.79109449311719, -73.8923914525939 40.7915039189505, -73.8924943995255 40.7920172619265, -73.89257156480841 40.79233568492049, -73.8926832253982 40.7926866149435, -73.892691849225 40.79306338658551))'
                ), {
                    u'amenity': u'prison',
                    u'gnis:state_id': u'36',
                    u'name': u'Rikers Island',
                    u'way_area': u'2.91925e+06',
                    u'wikipedia': u'en:Rikers Island',
                    u'gnis:county_id': u'005',
                    u'ele': u'8',
                    u'source': u'openstreetmap.org',
                    u'wikidata': u'Q120119',
                    u'gnis:created': u'01/23/1980',
                    u'place': u'island',
                    u'gnis:feature_id': u'962524',
                    u'gnis:edited': u'10/27/2005'
                }))  # noqa

        self.assert_has_feature(13, 2414, 3077, 'pois', {
            'kind': 'prison',
            'name': 'Rikers Island'
        })
Ejemplo n.º 15
0
    def test_landuse_quarry(self):
        self.generate_fixtures(
            dsl.way(
                3356570361,
                wkt_loads('POINT (-122.153005130541 38.21004035449701)'), {
                    u'source': u'openstreetmap.org',
                    u'landuse': u'quarry',
                    u'resource': u'rock'
                }))  # noqa

        self.assert_has_feature(15, 5265, 12615, 'pois', {'id': 3356570361})

        # Way:184367568 quarry in POIS
        self.generate_fixtures(
            dsl.way(
                184367568,
                wkt_loads(
                    'POLYGON ((-120.977489333016 37.75803770943879, -120.977486997396 37.76081756655368, -120.976233937406 37.76077552360858, -120.975400929643 37.7607743873124, -120.974583372903 37.76077332203479, -120.973504316584 37.76062567440368, -120.97213699089 37.76035516386188, -120.971016971394 37.7601061001177, -120.970661597867 37.7599816034407, -120.97063294161 37.75963545470499, -120.970616682103 37.7594398664594, -120.970625485593 37.75941607482559, -120.970835242212 37.75885182025329, -120.970928667001 37.7585999816441, -120.971144981322 37.75855530967489, -120.971802368447 37.75841951808628, -120.971967209301 37.7582608575149, -120.9720635087 37.75745135660739, -120.971951219289 37.75722600441009, -120.972019042093 37.75718296511631, -120.972093961588 37.75713530936738, -120.972331386317 37.7569844584784, -120.972452838544 37.75689695914001, -120.972641574585 37.75557287981598, -120.972647683129 37.75482471444889, -120.975799062977 37.75418158732738, -120.975874970619 37.75416880285528, -120.976019329885 37.7541445833771, -120.976370571161 37.75533779164638, -120.976515469416 37.75582998445129, -120.976667733857 37.7561338213188, -120.976875693845 37.75641066831778, -120.97701762766 37.7564229552437, -120.977076287648 37.75642806887698, -120.977279396734 37.75644568250009, -120.977288110392 37.75651152048169, -120.977319461596 37.7567493747943, -120.977408125314 37.75742181157429, -120.977429145892 37.7575811841611, -120.977489333016 37.75803770943879))'
                ), {
                    u'attribution': u'Farmland Mapping and Monitoring Program',
                    u'way_area': u'508870',
                    u'source': u'openstreetmap.org',
                    u'FMMP_modified': u'no',
                    u'addr:county': u'San Joaquin',
                    u'landuse': u'quarry',
                    u'FMMP_reviewed': u'no'
                }))  # noqa

        self.assert_has_feature(12, 671, 1583, 'pois', {'id': 184367568})
Ejemplo n.º 16
0
    def test_motorway_level_0(self):
        # tunnels at level = 0
        self.generate_fixtures(
            dsl.way(
                3685132833,
                wkt_loads('POINT (-122.455329276656 37.80300739883197)'), {
                    u'source': u'openstreetmap.org',
                    u'ref': u'437',
                    u'highway': u'motorway_junction'
                }),
            dsl.way(
                167952621,
                wkt_loads(
                    'LINESTRING (-122.455329276656 37.80300739883197, -122.454934107763 37.80304260388298, -122.45454783219 37.80306545876599, -122.454197309567 37.803080789988)'
                ), {
                    u'lanes': u'3',
                    u'name': u'Presidio Parkway',
                    u'tunnel': u'yes',
                    u'destination:street': u'Marina Boulevard',
                    u'source': u'openstreetmap.org',
                    u'alt_name': u'Doyle Drive',
                    u'oneway': u'yes',
                    u'ref': u'US 101',
                    u'highway': u'motorway'
                }))  # noqa

        self.assert_has_feature(
            16, 10475, 25324, "roads", {
                "kind": "highway",
                "kind_detail": "motorway",
                "id": 167952621,
                "name": "Presidio Pkwy.",
                "is_tunnel": True,
                "sort_rank": 333
            })
Ejemplo n.º 17
0
    def test_unit_conversion_height(self):
        # Rainbow Falls - height 150ft = 45m
        self.generate_fixtures(
            dsl.way(
                877270365,
                wkt_loads('POINT (-82.96562582334471 35.09064146759331)'), {
                    u'source': u'openstreetmap.org',
                    u'waterway': u'waterfall',
                    u'name': u'Rainbow Falls',
                    u'height': u'150 ft'
                }))  # noqa

        self.assert_has_feature(14, 4416, 6484, 'pois', {
            'kind': 'waterfall',
            'min_zoom': 14,
            'height': 45.72
        })

        # Toccoa Falls - height 186' = 56.6929m
        self.generate_fixtures(
            dsl.way(
                404574988,
                wkt_loads('POINT (-83.3606066994399 34.59619179112848)'), {
                    u'source': u'openstreetmap.org',
                    u'waterway': u'waterfall',
                    u'natural': u'cliff',
                    u'name': u'Toccoa Falls',
                    u'height': u"186'"
                }))  # noqa

        self.assert_has_feature(13, 2199, 3256, 'pois', {
            'kind': 'waterfall',
            'min_zoom': 13,
            'height': 56.6928
        })

        # Eternal Flame Falls - height 9m (with unit)
        self.generate_fixtures(
            dsl.way(
                3647404249,
                wkt_loads('POINT (-78.7516626920262 42.70175278571357)'), {
                    u'natural': u'cliff',
                    u'name': u'Eternal Flame Falls',
                    u'height': u'9 m',
                    u'source': u'openstreetmap.org',
                    u'waterway': u'waterfall',
                    u'tourism': u'attraction'
                }))  # noqa

        self.assert_has_feature(15, 9215, 12077, 'pois', {
            'kind': 'waterfall',
            'min_zoom': 15,
            'height': 9
        })
Ejemplo n.º 18
0
 def test_invalid_geometry_created_by_insert_coord(self):
     geom = wkt_loads(
         "POLYGON ((1087.38777718021 587.6238258803972, 1066.990091678121 587.6238258803972, 1066.990091580104 587.6238258852126, 1066.990091483031 587.6238258996119, 1066.990091387836 587.6238259234569, 1066.990091295438 587.6238259565177, 1066.990091206724 587.623825998476, 1066.990091122551 587.6238260489276, 1066.990091043728 587.6238261073868, 1066.990090971014 587.6238261732905, 1066.990090905111 587.623826246004, 1066.990090846652 587.6238263248271, 1066.9900907962 587.6238264090005, 1066.990090754242 587.6238264977138, 1066.990090721181 587.6238265901126, 1066.990090697336 587.6238266853069, 1066.990090682936 587.6238267823801, 1066.990090678121 587.6238268803972, 1066.990090678121 615.1628893803972, 1066.990090682936 615.1628894784144, 1066.990090697336 615.1628895754876, 1066.990090721181 615.1628896706819, 1066.990090754242 615.1628897630807, 1066.9900907962 615.162889851794, 1066.990090846652 615.1628899359674, 1066.990090905111 615.1628900147905, 1066.990090971014 615.162890087504, 1066.990091043728 615.1628901534077, 1066.990091122551 615.1628902118669, 1066.990091206724 615.1628902623185, 1066.990091295438 615.1628903042767, 1066.990091387836 615.1628903373376, 1066.990091483031 615.1628903611826, 1066.990091580104 615.1628903755819, 1066.990091678121 615.1628903803972, 1087.38777718021 615.1628903803972, 1087.387777278227 615.1628903755819, 1087.3877773753 615.1628903611826, 1087.387777470495 615.1628903373376, 1087.387777562894 615.1628903042767, 1087.387777651607 615.1628902623185, 1087.38777773578 615.1628902118669, 1087.387777814603 615.1628901534077, 1087.387777887317 615.162890087504, 1087.387777953221 615.1628900147905, 1087.38777801168 615.1628899359674, 1087.387778062131 615.162889851794, 1087.38777810409 615.1628897630807, 1087.38777813715 615.1628896706819, 1087.387778160995 615.1628895754876, 1087.387778175395 615.1628894784144, 1087.38777818021 615.1628893803972, 1087.38777818021 587.6238268803972, 1087.387778175395 587.6238267823801, 1087.387778160995 587.6238266853069, 1087.38777813715 587.6238265901126, 1087.38777810409 587.6238264977138, 1087.387778062131 587.6238264090005, 1087.38777801168 587.6238263248271, 1087.387777953221 587.623826246004, 1087.387777887317 587.6238261732905, 1087.387777814603 587.6238261073868, 1087.38777773578 587.6238260489276, 1087.387777651607 587.623825998476, 1087.387777562894 587.6238259565177, 1087.387777470495 587.6238259234569, 1087.3877773753 587.6238258996119, 1087.387777278227 587.6238258852126, 1087.38777718021 587.6238258803972))"
     )
     other_geom = wkt_loads(
         "POLYGON ((1107.224685371296 596.8330699036721, 1097.188366375415 596.8330699036721, 1097.188366277398 596.8330699084875, 1097.188366180325 596.8330699228868, 1097.18836608513 596.8330699467318, 1097.188365992732 596.8330699797926, 1097.188365904018 596.8330700217509, 1097.188365819845 596.8330700722025, 1097.188365741022 596.8330701306617, 1097.188365668308 596.8330701965654, 1097.188365602405 596.8330702692789, 1097.188365543946 596.833070348102, 1097.188365493494 596.8330704322753, 1097.188365451536 596.8330705209887, 1097.188365418475 596.8330706133875, 1097.18836539463 596.8330707085818, 1097.18836538023 596.833070805655, 1097.188365375415 596.8330709036721, 1097.188365375415 602.9854146536721, 1097.18836538023 602.9854147516893, 1097.18836539463 602.9854148487625, 1097.188365418475 602.9854149439568, 1097.188365451536 602.9854150363556, 1097.188365493494 602.9854151250689, 1097.188365543946 602.9854152092423, 1097.188365602405 602.9854152880654, 1097.188365668308 602.9854153607789, 1097.188365741022 602.9854154266826, 1097.188365819845 602.9854154851417, 1097.188365904018 602.9854155355933, 1097.188365992732 602.9854155775516, 1097.18836608513 602.9854156106124, 1097.188366180325 602.9854156344575, 1097.188366277398 602.9854156488568, 1097.188366375415 602.9854156536721, 1107.224685371296 602.9854156536721, 1107.224685469313 602.9854156488568, 1107.224685566386 602.9854156344575, 1107.22468566158 602.9854156106124, 1107.224685753979 602.9854155775516, 1107.224685842692 602.9854155355933, 1107.224685926866 602.9854154851417, 1107.224686005689 602.9854154266826, 1107.224686078403 602.9854153607789, 1107.224686144306 602.9854152880654, 1107.224686202765 602.9854152092423, 1107.224686253217 602.9854151250689, 1107.224686295175 602.9854150363556, 1107.224686328236 602.9854149439568, 1107.224686352081 602.9854148487625, 1107.22468636648 602.9854147516893, 1107.224686371296 602.9854146536721, 1107.224686371296 596.8330709036721, 1107.22468636648 596.833070805655, 1107.224686352081 596.8330707085818, 1107.224686328236 596.8330706133875, 1107.224686295175 596.8330705209887, 1107.224686253217 596.8330704322753, 1107.224686202765 596.833070348102, 1107.224686144306 596.8330702692789, 1107.224686078403 596.8330701965654, 1107.224686005689 596.8330701306617, 1107.224685926866 596.8330700722025, 1107.224685842692 596.8330700217509, 1107.224685753979 596.8330699797926, 1107.22468566158 596.8330699467318, 1107.224685566386 596.8330699228868, 1107.224685469313 596.8330699084875, 1107.224685371296 596.8330699036721))"
     )
     projector = Projector(geom, None)
     new_geom = projector._insert_other_geom_projections_into_geom(
         other_geom, Vector2D(-1, 0), geom)
     self.assertTrue(new_geom.is_valid)
Ejemplo n.º 19
0
    def test_park_with_building_tags_should_appear_in_landuse(self):
        # This test make sure park polygons with addresses still end up in
        # the landuse layer
        # Because it's a relation, it's ID will be negative.
        # (Separately a address point is generated for the feature, but we
        # don't test that here.)
        # Way: Olympic Sculpture Park (239782410)
        self.generate_fixtures(
            dsl.way(
                508853910,
                wkt_loads(
                    'LINESTRING (-122.355318039444 47.61536890970269, -122.355521507856 47.61585977285878)'
                ), {
                    u'source': u'openstreetmap.org',
                    u'layer': u'2',
                    u'man_made': u'bridge'
                }),
            dsl.way(
                239782410,
                wkt_loads(
                    'LINESTRING (-122.355739439144 47.6159988680818, -122.355618346244 47.61554331016748)'
                ), {
                    u'source': u'openstreetmap.org',
                    u'layer': u'2',
                    u'man_made': u'bridge'
                }),
            dsl.way(
                -7406606,
                wkt_loads(
                    'POLYGON ((-122.357852007198 47.61672909679339, -122.357554036018 47.6169097903414, -122.356940127353 47.61643268293529, -122.356288938604 47.61593879739959, -122.356138111467 47.61584796458379, -122.355618346244 47.61554331016748, -122.355739439144 47.6159988680818, -122.357017112973 47.6168760011799, -122.356663446246 47.6171398951622, -122.356482166221 47.61699099323719, -122.356161557496 47.6171859765585, -122.35620647326 47.61721328627618, -122.355769083549 47.61755129583639, -122.354815162548 47.61697700527541, -122.353628308395 47.61627917683448, -122.353639896662 47.61619639840689, -122.354210865857 47.61577408711059, -122.35425982404 47.6157674865772, -122.354551596844 47.61592868468718, -122.35571213036 47.61674266094208, -122.356054029157 47.61684590579709, -122.355867988061 47.61656868835849, -122.35578327693 47.61650571171499, -122.354844986616 47.61580721087577, -122.354634601176 47.61568186123319, -122.354522671092 47.61561531074531, -122.354509286194 47.61556571574061, -122.35476234161 47.61536539746518, -122.355521507856 47.61585977285878, -122.355318039444 47.61536890970269, -122.35507208072 47.61522508943741, -122.354962845581 47.6151615661711, -122.354996712067 47.6151090034863, -122.355008390166 47.61502888767959, -122.354995274763 47.61496966367098, -122.355237460564 47.61497438706068, -122.356276901179 47.61555348350998, -122.35706571183 47.616087581211, -122.357852007198 47.61672909679339))'
                ), {
                    u'website': u'http://www.seattleartmuseum.org/visit/OSP/',
                    u'addr:housenumber': u'2901',
                    u'name': u'Olympic Sculpture Park',
                    u'addr:postcode': u'98121',
                    u'wheelchair': u'yes',
                    u'way_area': u'74439.2',
                    u'wikipedia': u'en:Olympic Sculpture Park',
                    u'leisure': u'park',
                    u'source': u'openstreetmap.org',
                    u'operator': u'Seattle Art Museum',
                    u'opening_hours': u'Mo-Su sunrise-sunset',
                    u'owner': u'Seattle Art Museum',
                    u'addr:street': u'Western Avenue',
                    u'addr:city': u'Seattle'
                }))  # noqa

        self.assert_no_matching_feature(16, 10493, 22885, 'buildings',
                                        {'id': -7406606})

        self.assert_has_feature(16, 10493, 22885, 'landuse', {
            'id': -7406606,
            'kind': 'park'
        })
    def test_roads_not_merged(self):
        # if we're merging, then only one of these will be in tiles. if
        # both exist then it's more likely that no merging is happening.
        self.generate_fixtures(
            dsl.way(
                89911760,
                wkt_loads(
                    'LINESTRING (-71.0727023957791 42.38242551026689, -71.07199631996571 42.3812520084956)'
                ), {
                    u'layer': u'-1',
                    u'lanes': u'2',
                    u'name': u'Sullivan Square Underpass',
                    u'source': u'openstreetmap.org',
                    u'tunnel': u'yes',
                    u'width': u'19.5',
                    u'condition': u'fair',
                    u'oneway': u'yes',
                    u'attribution':
                    u'Office of Geographic and Environmental Information (MassGIS)',
                    u'massgis:way_id': u'139891',
                    u'ref': u'MA 99',
                    u'highway': u'trunk'
                }),
            dsl.way(
                89912879,
                wkt_loads(
                    'LINESTRING (-71.0719030748393 42.38128558481939, -71.0726063658752 42.3824638635311)'
                ), {
                    u'layer': u'-1',
                    u'lanes': u'2',
                    u'name': u'Sullivan Square Underpass',
                    u'source': u'openstreetmap.org',
                    u'tunnel': u'yes',
                    u'width': u'19.5',
                    u'condition': u'fair',
                    u'oneway': u'yes',
                    u'attribution':
                    u'Office of Geographic and Environmental Information (MassGIS)',
                    u'massgis:way_id': u'139891',
                    u'ref': u'MA 99',
                    u'highway': u'trunk'
                }))  # noqa

        self.assert_has_feature(16, 19829, 24234, "roads", {
            "kind": "major_road",
            "kind_detail": "trunk",
            "id": 89912879
        })

        self.assert_has_feature(16, 19829, 24234, "roads", {
            "kind": "major_road",
            "kind_detail": "trunk",
            "id": 89911760
        })
Ejemplo n.º 21
0
    def test_offshore_platform_way(self):
        self.generate_fixtures(dsl.way(346405529, wkt_loads('POLYGON ((-119.906535907426 34.3897671631719, -119.906489105199 34.3899948169202, -119.905999703033 34.38992632070937, -119.906022879567 34.38981349457748, -119.905964219579 34.3898052661218, -119.905994133478 34.38965967421188, -119.906246110915 34.38969496025808, -119.906239822708 34.38972579847117, -119.906535907426 34.3897671631719))'), {u'building': u'industrial', u'source': u'openstreetmap.org', u'way_area': u'1944.96', u'man_made': u'offshore_platform', u'name': u'Platform Holly'}))  # noqa

        self.assert_has_feature(
            13, 1367, 3261, 'pois',
            {'kind': 'offshore_platform', 'min_zoom': 13})

        self.generate_fixtures(dsl.way(446514311, wkt_loads('POLYGON ((57.28399280807089 69.26576040721967, 57.28402739320939 69.2669031049751, 57.2874108078955 69.26689028887759, 57.287376222757 69.26574749503671, 57.28399280807089 69.26576040721967))'), {u'source': u'openstreetmap.org', u'way_area': u'135352', u'man_made': u'offshore_platform', u'name': u'\u041c\u041b\u0421\u041f \xab\u041f\u0440\u0438\u0440\u0430\u0437\u043b\u043e\u043c\u043d\u0430\u044f\xbb'}))  # noqa

        self.assert_has_feature(
            13, 5399, 1881, 'pois',
            {'kind': 'offshore_platform', 'min_zoom': 13, 'id': 446514311})
    def test_wood(self):
        self.generate_fixtures(dsl.way(52497271, wkt_loads('POLYGON ((-121.954353215747 37.34413271456221, -121.954112646914 37.34428461761629, -121.953889595229 37.34453921701549, -121.953810004495 37.3445377886903, -121.953726910331 37.3444308784707, -121.953744607142 37.34433389498678, -121.954353215747 37.34413271456221))'), {u'way_area': u'1191.25', u'source': u'openstreetmap.org', u'landuse': u'wood', u'natural': u'wood'}))  # noqa

        self.assert_has_feature(
            16, 10566, 25429, 'landuse',
            {'id': 52497271, 'kind': 'wood'})

        self.generate_fixtures(dsl.way(207859675, wkt_loads('POLYGON ((-117.89005453116 33.91136551127548, -117.890027671533 33.91175720307361, -117.889979432002 33.9118240007339, -117.889933797586 33.91180841958788, -117.889847469487 33.91179552227351, -117.889797074 33.91180402108199, -117.889737964854 33.91183958187699, -117.889576627429 33.91175772493049, -117.889617321111 33.91172156769318, -117.889649480799 33.9116391887757, -117.889606631159 33.91161481056499, -117.889652175744 33.91149455953338, -117.889550306791 33.91082009198559, -117.88888258904 33.91056646635377, -117.889542221954 33.91055297243508, -117.889633400955 33.9104550109947, -117.889421488379 33.91019899860129, -117.889343784107 33.91020347174229, -117.889270840906 33.9101460664147, -117.889118486634 33.90998756786778, -117.889356630016 33.90954725944538, -117.889737515696 33.90960742363259, -117.889998566118 33.90958871086019, -117.889974131942 33.9113676732641, -117.89005453116 33.91136551127548))'), {u'way_area': u'18306.8', u'source': u'openstreetmap.org', u'landuse': u'wood'}))  # noqa

        self.assert_has_feature(
            16, 11306, 26199, 'landuse',
            {'id': 207859675, 'kind': 'wood'})
    def test_historic_railway_halt(self):
        # Historic railway halt
        self.generate_fixtures(dsl.way(708144563, wkt_loads('POINT (14.8139903286339 59.15514209522067)'), {u'historic:railway': u'halt', u'historic': u'yes', u'disused': u'yes', u'name': u'Kvistbro', u'source': u'openstreetmap.org'}))  # noqa

        self.assert_no_matching_feature(
            13, 4433, 2416, 'pois',
            {'id': 708144563})

        self.generate_fixtures(dsl.way(2468597590, wkt_loads('POINT (9.147960458165631 46.24711157299198)'), {u'source': u'openstreetmap.org', u'railway': u'halt', u'historic': u'railway_station', u'name': u'Grono'}))  # noqa

        self.assert_no_matching_feature(
            13, 4304, 2906, 'pois',
            {'id': 2468597590})
    def test_landuse_quarry(self):
        self.generate_fixtures(dsl.way(3356570361, wkt_loads('POINT (-122.153005130541 38.21004035449701)'), {u'source': u'openstreetmap.org', u'landuse': u'quarry', u'resource': u'rock'}))  # noqa

        self.assert_has_feature(
            16, 10530, 25230, 'pois',
            {'id': 3356570361})

        # Way:184367568 quarry in POIS
        self.generate_fixtures(dsl.way(184367568, wkt_loads('POLYGON ((-120.977489333016 37.75803770943879, -120.977486997396 37.76081756655368, -120.976233937406 37.76077552360858, -120.975400929643 37.7607743873124, -120.974583372903 37.76077332203479, -120.973504316584 37.76062567440368, -120.97213699089 37.76035516386188, -120.971016971394 37.7601061001177, -120.970661597867 37.7599816034407, -120.97063294161 37.75963545470499, -120.970616682103 37.7594398664594, -120.970625485593 37.75941607482559, -120.970835242212 37.75885182025329, -120.970928667001 37.7585999816441, -120.971144981322 37.75855530967489, -120.971802368447 37.75841951808628, -120.971967209301 37.7582608575149, -120.9720635087 37.75745135660739, -120.971951219289 37.75722600441009, -120.972019042093 37.75718296511631, -120.972093961588 37.75713530936738, -120.972331386317 37.7569844584784, -120.972452838544 37.75689695914001, -120.972641574585 37.75557287981598, -120.972647683129 37.75482471444889, -120.975799062977 37.75418158732738, -120.975874970619 37.75416880285528, -120.976019329885 37.7541445833771, -120.976370571161 37.75533779164638, -120.976515469416 37.75582998445129, -120.976667733857 37.7561338213188, -120.976875693845 37.75641066831778, -120.97701762766 37.7564229552437, -120.977076287648 37.75642806887698, -120.977279396734 37.75644568250009, -120.977288110392 37.75651152048169, -120.977319461596 37.7567493747943, -120.977408125314 37.75742181157429, -120.977429145892 37.7575811841611, -120.977489333016 37.75803770943879))'), {u'attribution': u'Farmland Mapping and Monitoring Program', u'way_area': u'508870', u'source': u'openstreetmap.org', u'FMMP_modified': u'no', u'addr:county': u'San Joaquin', u'landuse': u'quarry', u'FMMP_reviewed': u'no'}))  # noqa

        self.assert_has_feature(
            14, 2686, 6333, 'pois',
            {'id': 184367568, 'min_zoom': 13})
    def test_man_made_offshore_platform(self):
        self.generate_fixtures(dsl.way(4239915448, wkt_loads('POINT (-97.05473509633438 26.12074297830959)'), {u'seamark:type': u'platform', u'man_made': u'offshore_platform', u'source': u'openstreetmap.org'}))  # noqa

        self.assert_has_feature(
            15, 7549, 13919, 'pois',
            {'id': 4239915448})

        # originally from 675-man_made-outdoor-landmarks.py
        self.generate_fixtures(dsl.way(350328482, wkt_loads('POLYGON ((-94.63139900237969 29.40923572279329, -94.63116238613378 29.40925700824868, -94.6311144160976 29.4088532881355, -94.6313510323435 29.40883200259559, -94.63139900237969 29.40923572279329))'), {u'source': u'openstreetmap.org', u'way_area': u'1373.41', u'man_made': u'offshore_platform', u'area': u'yes'}))  # noqa

        self.assert_has_feature(
            13, 1942, 3395, 'pois',
            {'id': 350328482})
Ejemplo n.º 26
0
    def test_height_missing(self):
        # Alamere Falls (no height)
        # Assume falls are important, show at zoom 14 default
        self.generate_fixtures(
            dsl.way(
                2375445789,
                wkt_loads('POINT (-122.783122278043 37.95391767741348)'), {
                    u'wikipedia': u'en:Alamere Falls',
                    u'waterway': u'waterfall',
                    u'wikidata': u'Q37957',
                    u'name': u'Alamere Falls',
                    u'source': u'openstreetmap.org'
                }))  # noqa

        self.assert_has_feature(14, 2604, 6322, 'pois', {
            'kind': 'waterfall',
            'min_zoom': 14
        })

        # Lower Chilnualna Fall, no height
        self.generate_fixtures(
            dsl.way(
                1247873121,
                wkt_loads('POINT (-119.631362801784 37.55080207032658)'), {
                    u'source': u'openstreetmap.org',
                    u'natural': u'waterfall',
                    u'name': u'Lower Chilnualna Fall'
                }))  # noqa

        self.assert_has_feature(14, 2747, 6345, 'pois', {
            'kind': 'waterfall',
            'min_zoom': 14
        })

        # https://www.openstreetmap.org/node/1247872815
        # Chilnualna Creek Cascades, no height
        self.generate_fixtures(
            dsl.way(
                1247872815,
                wkt_loads('POINT (-119.612561242551 37.56504890695991)'), {
                    u'note':
                    u'Series of cascades on Chilnualna Creek. Not technically part of Chilnualna Falls, but part of the same system',
                    u'source': u'openstreetmap.org',
                    u'natural': u'waterfall',
                    u'name': u'Chilnualna Creek Cascades'
                }))  # noqa

        self.assert_has_feature(14, 2748, 6344, 'pois', {
            'kind': 'waterfall',
            'min_zoom': 14
        })
Ejemplo n.º 27
0
    def test_proposed_stations(self):
        # Antioch Station
        self.generate_fixtures(dsl.way(3353451464, wkt_loads('POINT (-121.785229642994 37.99688077243528)'), {u'name': u'Antioch Station (in construction)', u'source': u'openstreetmap.org', u'state': u'proposed', u'train': u'yes', u'public_transport': u'station', u'operator': u'BART', u'railway': u'station'}))  # noqa

        self.assert_has_feature(
            16, 10597, 25279, 'pois',
            {'id': 3353451464, 'state': 'proposed'})

        # Pittsburg Center
        self.generate_fixtures(dsl.way(3354463416, wkt_loads('POINT (-121.88916373322 38.01684868163071)'), {u'toilets': u'yes', u'name': u'BART - Pittsburg Center Station (In Construction)', u'wheelchair': u'yes', u'source': u'openstreetmap.org', u'state': u'proposed', u'train': u'yes', u'public_transport': u'station', u'operator': u'BART', u'railway': u'station', u'toilets:wheelchair': u'yes'}))  # noqa

        self.assert_has_feature(
            16, 10578, 25275, 'pois',
            {'id': 3354463416, 'state': 'proposed'})
Ejemplo n.º 28
0
    def test_large_outdoor(self):
        # http://www.openstreetmap.org/way/377630800
        # Large Bass Pro building that should appear earlier
        self.generate_fixtures(dsl.way(377630800, wkt_loads('POLYGON ((-104.827294994284 39.02406511310399, -104.826632037605 39.02437706682608, -104.826394792538 39.02407285962249, -104.826073285498 39.0242241608225, -104.82564496877 39.02367478517689, -104.82595291125 39.0235299033882, -104.825856611851 39.0234063767732, -104.826482198615 39.02311200569858, -104.826618562875 39.0232869675069, -104.826799932731 39.0232016850202, -104.827087303791 39.0235703112002, -104.826957137906 39.0236315858692, -104.827294994284 39.02406511310399))'), {u'shop': u'outdoor', u'building': u'retail', u'way_area': u'18864.9', u'name': u'Bass Pro Shop', u'source': u'openstreetmap.org'}))  # noqa

        self.assert_has_feature(
            15, 6842, 12520, 'pois',
            {'kind': 'outdoor', 'id': 377630800})

        # Large REI building that should appear earlier
        self.generate_fixtures(dsl.way(290195878, wkt_loads('POLYGON ((-111.802024167649 40.70123485563938, -111.802023987986 40.7014723988414, -111.8015969289 40.70146919800679, -111.801545365603 40.7014105614151, -111.800970443821 40.70141709929548, -111.800970443821 40.70153416810739, -111.800824467587 40.70153416810739, -111.800807309766 40.70066878023668, -111.801682807841 40.70066878023668, -111.801777220778 40.70074035716837, -111.801785844605 40.70123485563938, -111.802024167649 40.70123485563938))'), {u'shop': u'outdoor', u'building': u'yes', u'name': u'REI', u'addr:postcode': u'84109', u'way_area': u'13133', u'addr:housenumber': u'3285', u'addr:city': u'Salt Lake City', u'source': u'openstreetmap.org', u'opening_hours': u'Mo-Fr 10:00-21:00;Sa 9:00-19:00;Su 11:00-18:00', u'internet_access': u'wlan', u'addr:street': u'3300 S'}))  # noqa

        self.assert_has_feature(
            15, 6207, 12321, 'pois',
            {'kind': 'outdoor', 'id': 290195878})
    def test_trunk_level_0(self):
        self.generate_fixtures(dsl.way(259492789, wkt_loads('LINESTRING (-74.16702601822249 40.73275266220829, -74.16711180733211 40.73254919807029)'), {u'tunnel': u'yes', u'tiger:name_base': u'McCarter', u'hgv:state_network': u'yes', u'name': u'McCarter Highway', u'tiger:cfcc': u'A35', u'tiger:name_base_1': u'State Route 21', u'hgv': u'designated', u'tiger:zip_left': u'07104', u'tiger:zip_right': u'07104', u'lanes': u'4', u'source': u'openstreetmap.org', u'tiger:county': u'Essex, NJ', u'tiger:name_type': u'Hwy', u'NHS': u'yes', u'ref': u'NJ 21', u'NJDOT_SRI': u'00000021', u'HFCS': u'Urban Principal Arterial', u'source:hgv:state_network': u'NJDOT http://www.state.nj.us/transportation/about/rules/pdf/chapter32truckaccess.pdf', u'highway': u'trunk'}))  # noqa

        self.assert_has_feature(
            16, 19266, 24635, "roads",
            {"kind": "major_road", "kind_detail": "trunk", "id": 259492789,
             "name": "McCarter Hwy.", "is_tunnel": True, "sort_rank": 331})

        self.generate_fixtures(dsl.way(277441866, wkt_loads('LINESTRING (-83.51858074221251 35.74467572285489, -83.5186876417313 35.74474476841309, -83.51881250755579 35.74482300053089, -83.5189321631516 35.74490640915329, -83.51904642885579 35.74499477553549, -83.51915494534208 35.74508795384219, -83.51925717362138 35.74518557950971, -83.5193531136938 35.74528736088479, -83.519442406233 35.74539315213308, -83.51952478174461 35.74550258869337, -83.5196001503969 35.74561537891499, -83.5196680630324 35.74573115823921, -83.51972860948248 35.745849707927, -83.51978143042119 35.7459706634228, -83.519826436017 35.74609380599009, -83.51986353643818 35.74621847944319, -83.51989255202189 35.74634468377489, -83.519913482768 35.746471981529, -83.51992632867659 35.74660000815989, -83.51993082025298 35.74672825330868)'), {u'unsigned_ref': u'SR 71;SR 73', u'lanes': u'2', u'name': u'Gatlinburg Spur Road (north)', u'tunnel': u'yes', u'surface': u'paved', u'source': u'openstreetmap.org', u'official_name': u'Gatlinburg Spur Road (north)', u'NHS': u'yes', u'oneway': u'yes', u'ref': u'US 321;US 441', u'highway': u'trunk'}))  # noqa

        self.assert_has_feature(
            16, 17563, 25792, "roads",
            {"kind": "major_road", "kind_detail": "trunk", "id": 277441866,
             "name": "Gatlinburg Spur Road (north)", "is_tunnel": True,
             "sort_rank": 331})
    def test_unnamed_rock(self):
        # originally from 657-natural-man_made.py
        # unnamed rock
        self.generate_fixtures(dsl.way(4013703516, wkt_loads('POINT (-122.523488499681 38.0215078752183)'), {u'source': u'openstreetmap.org', u'natural': u'rock'}))  # noqa

        self.assert_has_feature(
            16, 10463, 25274, 'pois',
            {'id': 4013703516})

        # another unnamed rock
        self.generate_fixtures(dsl.way(3150154140, wkt_loads('POINT (-122.416442645311 37.93267727336828)'), {u'source': u'openstreetmap.org', u'natural': u'rock'}))  # noqa

        self.assert_has_feature(
            16, 10482, 25294, 'pois',
            {'id': 3150154140})
Ejemplo n.º 31
0
    def test_building_ranger_station(self):
        # Building with amenity=ranger_station
        self.generate_fixtures(dsl.way(361301773, wkt_loads('POLYGON ((-122.477381030419 37.83698367631209, -122.47725293066 37.83702865560479, -122.47713597001 37.83682106955531, -122.477264069769 37.83677609013608, -122.477381030419 37.83698367631209))'), {u'building': u'yes', u'addr:housenumber': u'T507', u'amenity': u'ranger_station', u'addr:city': u'Sausalito', u'building:levels': u'2', u'way_area': u'499.794', u'addr:state': u'CA', u'source': u'openstreetmap.org', u'addr:country': u'US', u'addr:street': u'McReynolds Road'}))  # noqa

        self.assert_has_feature(
            14, 2617, 6329, 'pois',
            {'kind': 'ranger_station', 'min_zoom': 14})

        # Entrance Yosemite Nationalpark
        # Building with amenity=ranger_station
        self.generate_fixtures(dsl.way(269908344, wkt_loads('POLYGON ((-119.731012377263 37.68609727879108, -119.730953896938 37.68613026461198, -119.730923533881 37.68610751577161, -119.730981565048 37.68607140197321, -119.731012377263 37.68609727879108))'), {u'building': u'yes', u'source': u'openstreetmap.org', u'amenity': u'ranger_station', u'way_area': u'38.727', u'name': u'Entrance Yosemite Nationalpark'}))  # noqa

        self.assert_has_feature(
            14, 2742, 6337, 'pois',
            {'kind': 'ranger_station', 'min_zoom': 14})
Ejemplo n.º 32
0
    def test_bicycle_rental_stations(self):
        # Citi Bike - Broadway & W 24 St, with network, operator
        self.generate_fixtures(
            dsl.way(
                3708656264,
                wkt_loads('POINT (-73.98911000496309 40.7427403594615)'), {
                    u'website': u'http://citibikenyc.com',
                    u'amenity': u'bicycle_rental',
                    u'capacity': u'52',
                    u'name': u'Citi Bike - Broadway & W 24 St',
                    u'source': u'openstreetmap.org',
                    u'operator': u'NYC Bike Share',
                    u'network': u'Citi Bike'
                }))  # noqa

        self.assert_has_feature(
            16, 19298, 24633, 'pois', {
                'kind': 'bicycle_rental_station',
                'min_zoom': 17,
                'capacity': 52,
                'network': 'Citi Bike',
                'operator': 'NYC Bike Share'
            })

        # Alta Bike Share, Chattanooga, with network, operator, ref, capacity.
        self.generate_fixtures(
            dsl.way(
                1960994139,
                wkt_loads('POINT (-85.3072689456985 35.03690398638529)'), {
                    u'amenity': u'bicycle_rental',
                    u'capacity': u'19',
                    u'name': u'Chattanooga Choo Choo',
                    u'source': u'openstreetmap.org',
                    u'alt_name': u'Market St & E 14th St',
                    u'operator': u'Alta Bike Share',
                    u'ref': u'5',
                    u'network': u'Bike Chattanooga'
                }))  # noqa

        self.assert_has_feature(
            16, 17238, 25950, 'pois', {
                'kind': 'bicycle_rental_station',
                'min_zoom': 17,
                'capacity': 19,
                'network': 'Bike Chattanooga',
                'operator': 'Alta Bike Share',
                'ref': '5'
            })
Ejemplo n.º 33
0
    def test_bridleway(self):
        # Add bridleway from osm
        self.generate_fixtures(dsl.way(387216146, wkt_loads('LINESTRING (-73.97052484988149 40.78065205698829, -73.970491432553 40.78072477229578, -73.97047813748669 40.78076721786419, -73.9704661000619 40.7808247642164, -73.97046340511611 40.78087231134219, -73.97046744753489 40.78092781695659, -73.97047140012208 40.78098481899768, -73.97048613249279 40.78112555533131, -73.97048119175869 40.78128118801019, -73.97042486739041 40.781467973952, -73.9703578530702 40.78155129963059, -73.97026658423729 40.78166101728299, -73.97014567100008 40.78172209993969, -73.9700498207593 40.781767197678, -73.9697649649827 40.78182746398939, -73.9695612270762 40.78183970770289, -73.96921789097459 40.78185589660939, -73.9689121044519 40.78192296489458, -73.9686680321892 40.78201030320901, -73.96843743465578 40.78215035716669, -73.96830592129821 40.7822825204897, -73.96827367177949 40.7823981546791, -73.9682308221405 40.78264187007889, -73.96820405234499 40.78288361201739, -73.96815302803688 40.78312725761661, -73.96802968934838 40.78335280925068, -73.9678553263517 40.7835801966276, -73.96775354723 40.78366161513108, -73.96757639945599 40.7838380555557, -73.9673731107072 40.7840511574173, -73.96726791798739 40.78417120971298, -73.9672429448225 40.78421508146098, -73.9671638930775 40.78436315689859)'), {u'source': u'openstreetmap.org', u'highway': u'bridleway'}))  # noqa

        self.assert_has_feature(
            16, 19302, 24623, 'roads',
            {'id': 387216146, 'kind': 'path', 'kind_detail': 'bridleway'})
    def test_public_transport_stop_position(self):
        # originally from 661-historic-transit-stops.py
        self.generate_fixtures(dsl.way(3721890342, wkt_loads('POINT (-122.15620591773 37.438295280187)'), {u'source': u'openstreetmap.org', u'railway': u'stop', u'network': u'Caltrain', u'public_transport': u'stop_position'}))  # noqa

        self.assert_has_feature(
            16, 10530, 25408, 'pois',
            {'id': 3721890342, 'kind': 'stop', 'min_zoom': 16})
    def test_valle_az(self):
        # Valle, AZ (disused=station)
        self.generate_fixtures(dsl.way(366220389, wkt_loads('POINT (-112.200039193448 35.65261688375637)'), {u'name': u'Valle', u'gnis:reviewed': u'no', u'addr:state': u'AZ', u'ele': u'1794', u'source': u'openstreetmap.org', u'gnis:feature_id': u'21103', u'disused': u'station', u'gnis:county_name': u'Coconino'}))  # noqa

        self.assert_no_matching_feature(
            16, 12342, 25813, 'pois',
            {'id': 366220389})
Ejemplo n.º 36
0
    def test_corridor(self):
        # Way: The Nave (205644309)
        self.generate_fixtures(dsl.way(2156202856, wkt_loads('POINT (-122.400024406358 37.76714596457248)'), {u'source': u'openstreetmap.org', u'entrance': u'main_entrance'}),dsl.way(205644309, wkt_loads('LINESTRING (-122.399059525911 37.76790309481861, -122.400024406358 37.76714596457248, -122.400131395708 37.7670594714286)'), {u'source': u'openstreetmap.org', u'name': u'The Nave', u'highway': u'corridor'}))  # noqa

        self.assert_has_feature(
            16, 10485, 25332, 'roads',
            {'id': 205644309, 'kind': 'path', 'kind_detail': 'corridor'})
    def test_fences_around_enclosures(self):
        # barrier=fence around enclosures
        self.generate_fixtures(dsl.way(316623706, wkt_loads('POLYGON ((-117.060170479934 51.29075749793969, -117.05995748938 51.29087490941641, -117.059694013507 51.29098546693429, -117.059412481497 51.29109158617149, -117.059033482278 51.29119309862668, -117.058712334564 51.29129916120679, -117.058380317235 51.2914324132113, -117.05816373342 51.29160841537159, -117.058026560676 51.29169419722047, -117.057813570123 51.29184986249769, -117.057618725537 51.29198991023731, -117.057373305802 51.2921297890213, -117.057124202974 51.29228326196, -117.056741700326 51.29207338814918, -117.056579195091 51.29192440861999, -117.056279696775 51.2916557723649, -117.056041463562 51.29141426804119, -117.055846618977 51.29120219934499, -117.055637221684 51.2909267613749, -117.055427914223 51.29062430015458, -117.055597516148 51.29052497738771, -117.055918843525 51.29042346345539, -117.056175043044 51.2903421734983, -117.056232804717 51.2902180754217, -117.056384260674 51.29010290941009, -117.056730830711 51.28999229358838, -117.057080904177 51.28990426140589, -117.057297487992 51.28982077955029, -117.057640374936 51.28966280404911, -117.057947239437 51.28954319848048, -117.058271980412 51.28939870509998, -117.058517400148 51.28928359321298, -117.058687091905 51.2891933124828, -117.058863880353 51.28907370569137, -117.059109300088 51.28892921083359, -117.059286178368 51.28917977316698, -117.059112983181 51.28933100878368, -117.058867473614 51.28956117585217, -117.058982996959 51.28979151030399, -117.059246472832 51.2898839808345, -117.0595748969 51.29001718076711, -117.059722939259 51.29009616797609, -117.059823999728 51.2901277965288, -117.05995748938 51.29029251183658, -117.060051363327 51.29050020284048, -117.060145237274 51.29068300610069, -117.060170479934 51.29075749793969))'), {u'name': u'Bear Enclosure', u'barrier': u'fence', u'area': u'yes', u'way_area': u'150889', u'zoo': u'enclosure', u'source': u'openstreetmap.org', u'tourism': u'zoo'}))  # noqa

        self.assert_has_feature(
            16, 11458, 21855, 'landuse',
            {'kind': 'fence'})
    def test_rope_tow(self):
        self.generate_fixtures(dsl.way(209129274, wkt_loads('LINESTRING (-121.11701826806 39.14406599692289, -121.11745970019 39.14463700862707)'), {u'source': u'openstreetmap.org', u'name': u'Zip Line', u'aerialway': u'rope_tow'}))  # noqa

        self.assert_has_feature(
            16, 10719, 25012, "roads",
            {"kind": "aerialway", "kind_detail": "rope_tow", "id": 209129274,
             "sort_rank": 440})
    def test_cable_car(self):
        self.generate_fixtures(dsl.way(384371038, wkt_loads('LINESTRING (-98.18087867736098 19.05732433042759, -98.18652638555228 19.06035322854389)'), {u'aerialway:occupancy': u'40', u'aerialway:heating': u'yes', u'name': u'Telef\xe9rico de Puebla', u'aerialway': u'cable_car', u'source': u'openstreetmap.org'}))  # noqa

        self.assert_has_feature(
            16, 14894, 29232, "roads",
            {"kind": "aerialway", "kind_detail": "cable_car", "id": 384371038,
             "sort_rank": 442})
    def test_duplicate_names(self):
        self.generate_fixtures(dsl.way(206270454, wkt_loads('POINT (19.94780199025289 50.06866631266201)'), {u'name:en': u'Krakow Main Station', u'uic_ref': u'5100028', u'name': u'Krak\xf3w G\u0142\xf3wny', u'designation': u'A', u'platforms': u'5', u'wikipedia': u'pl:Krak\xf3w G\u0142\xf3wny', u'name:cs': u'Krakov hlavn\xed n\xe1dra\u017e\xed', u'name:de': u'Krakau Hauptbahnhof', u'source': u'openstreetmap.org', u'wikidata': u'Q2154725', u'name:pl': u'Krak\xf3w G\u0142\xf3wny', u'railway': u'station'}))  # noqa

        self.assert_has_feature(
            15, 18199, 11103, 'pois',
            {'id': 206270454, 'kind': 'station',
             'name': None, 'name:pl': None})
    def test_shop_wine(self):
        # Wine, New York, NY (shop=wine)
        self.generate_fixtures(dsl.way(2549960970, wkt_loads('POINT (-73.99107794425609 40.7455829198091)'), {u'shop': u'wine', u'addr:housenumber': u'795A', u'name': u'Wine & Liquior', u'addr:postcode': u'10001', u'source': u'openstreetmap.org', u'addr:street': u'Avenue Of The Americas'}))  # noqa

        self.assert_has_feature(
            16, 19298, 24632, 'pois',
            {'kind': 'wine'})
    def test_shop_alcohol(self):
        # Noe Valley Wine Merchants, San Francisco, CA
        self.generate_fixtures(dsl.way(1713269631, wkt_loads('POINT (-122.427979978 37.7515696737989)'), {u'shop': u'alcohol', u'addr:housenumber': u'3821', u'name': u'Noe Valley Wine Merchants', u'addr:city': u'San Francisco', u'source': u'openstreetmap.org', u'addr:street': u'24th Street'}))  # noqa

        self.assert_has_feature(
            16, 10480, 25336, 'pois',
            {'kind': 'alcohol'})
    def test_secondary(self):
        self.generate_fixtures(
            dsl.way(
                25337673,
                wkt_loads(
                    'LINESTRING (-122.419881845376 37.7703699989066, -122.419836570286 37.77048489185808, -122.419771622091 37.77063756144948)'
                ), {
                    u'tiger:name_base': u'Mission',
                    u'lanes': u'2',
                    u'name': u'Mission Street',
                    u'tiger:cfcc': u'A41; A45',
                    u'source': u'openstreetmap.org',
                    u'tiger:county': u'San Francisco, CA',
                    u'tiger:name_type': u'St',
                    u'oneway': u'yes',
                    u'highway': u'secondary',
                    u'trolley_wire': u'yes'
                }))  # noqa

        self.assert_has_feature(
            16, 10482, 25332, "roads", {
                "kind": "major_road",
                "kind_detail": "secondary",
                "id": 25337673,
                "name": "Mission St.",
                "sort_rank": 379
            })
Ejemplo n.º 44
0
    def test_subway(self):
        self.generate_fixtures(dsl.way(101647480, wkt_loads('LINESTRING (-122.470410283477 37.6963250949029, -122.470486730108 37.69652141854918, -122.4706878629 37.6970339046909, -122.470759009471 37.69722070181008, -122.470824676318 37.6974158858161, -122.470882258328 37.69761441002629, -122.47092528763 37.69781698520299, -122.470956099844 37.69802816035058, -122.470974874633 37.69825205794847, -122.470987990037 37.69851305772319, -122.470991044309 37.69875507875209, -122.471008291962 37.69974149285229)'), {u'source': u'openstreetmap.org', u'railway': u'subway', u'name': u'Bay Area Rapid Transit'}))  # noqa

        self.assert_has_feature(
            16, 10472, 25348, 'roads',
            {'kind': 'rail', 'kind_detail': 'subway', 'id': 101647480,
             'sort_rank': 382})
    def test_wall_kind_detail_from_wall_col(self):
        self.generate_fixtures(dsl.way(526327448, wkt_loads('LINESTRING (-121.898961478361 37.1606955709096, -121.899014478963 37.16068669365728, -121.899056789612 37.16065970393998, -121.899079067832 37.16062040059451, -121.899076822043 37.16057730291339, -121.899050321742 37.1605395745246, -121.899005316147 37.16051559157309, -121.898951596893 37.16051036543639, -121.898900572585 37.16052511316369, -121.898863472163 37.16055646997238, -121.898848290635 37.16059792107618, -121.898858082272 37.16064030283759, -121.898890960611 37.16067466641039)'), {u'wall': u'dry_stone', u'source': u'openstreetmap.org', u'barrier': u'wall', u'height': u'0.5'}))  # noqa

        self.assert_has_feature(
            16, 10576, 25471, 'landuse',
            {'id': 526327448, 'kind': 'wall', 'kind_detail': 'dry_stone',
             'min_zoom': 16})
Ejemplo n.º 46
0
    def test_zoo_appears_at_z13(self):
        # Zoo Montana, Billings, MT
        self.generate_fixtures(dsl.way(2274329294, wkt_loads('POINT (-108.620965329915 45.7322965681428)'), {u'addr:housenumber': u'2100', u'name': u'Zoo Montana', u'addr:city': u'Billings, MT 59106', u'source': u'openstreetmap.org', u'tourism': u'zoo', u'addr:street': u'S. Shiloh Road'}))  # noqa

        self.assert_has_feature(
            13, 1624, 2923, 'pois',
            {'kind': 'zoo'})
    def test_chair_lift(self):
        self.generate_fixtures(dsl.way(113791306, wkt_loads('LINESTRING (-122.029130596965 37.06861081628058, -122.028981566459 37.06925956980519)'), {u'source': u'openstreetmap.org', u'name': u'Zip Line', u'aerialway': u'chair_lift'}))  # noqa

        self.assert_has_feature(
            16, 10553, 25492, "roads",
            {"kind": "aerialway", "kind_detail": "chair_lift", "id": 113791306,
             "sort_rank": 441})
    def test_fence_kind_detail_from_fence_type_col(self):
        self.generate_fixtures(dsl.way(231049157, wkt_loads('LINESTRING (-122.007559801205 37.7572282060895, -122.008053066127 37.7569186209177, -122.009316546574 37.75615150603488, -122.01100313352 37.75508906612929, -122.011098085446 37.75420488347088, -122.011953191765 37.75436788524539)'), {u'source': u'openstreetmap.org', u'fence_type': u'barbed_wire', u'barrier': u'fence'}))  # noqa

        self.assert_has_feature(
            16, 10556, 25335, 'landuse',
            {'id': 231049157, 'kind': 'fence', 'kind_detail': 'barbed_wire',
             'min_zoom': 16})
    def test_gondola(self):
        self.generate_fixtures(dsl.way(32051122, wkt_loads('LINESTRING (-73.8612524312483 44.35322360623517, -73.89189926564978 44.35616478273359)'), {u'source': u'openstreetmap.org', u'aerialway:capacity': u'1800', u'name': u'Cloudsplitter Gondola', u'aerialway': u'gondola', u'aerialway:occupancy': u'8'}))  # noqa

        self.assert_has_feature(
            16, 19321, 23740, "roads",
            {"kind": "aerialway", "kind_detail": "gondola", "id": 32051122,
             "sort_rank": 442})
    def test_yard(self):
        self.generate_fixtures(dsl.way(1344032371, wkt_loads('POINT (-122.401192216227 37.7716789726811)'), {u'source': u'openstreetmap.org', u'railway': u'buffer_stop'}),dsl.way(119709585, wkt_loads('LINESTRING (-122.399873579222 37.772668676103, -122.400049469354 37.77256117129298, -122.400127802447 37.77251331243039, -122.400226886623 37.7724467076115, -122.400287522904 37.7724011919172, -122.401192216227 37.7716789726811)'), {u'service': u'yard', u'electrified': u'no', u'source': u'openstreetmap.org', u'gauge': u'1435', u'railway': u'rail', u'railway:traffic_mode': u'passenger'}))  # noqa

        self.assert_has_feature(
            16, 10485, 25331, "roads",
            {"kind": "rail", "kind_detail": "rail", "service": "yard",
             "id": 119709585, "sort_rank": 359})
    def test_old_south_ferry(self):
        # Old South Ferry (1) (disused=yes)
        self.generate_fixtures(dsl.way(2086974744, wkt_loads('POINT (-74.01325716895789 40.701283821753)'), {u'name': u'Old South Ferry (1)', u'wheelchair': u'no', u'source': u'openstreetmap.org', u'railway': u'station', u'disused': u'yes', u'network': u'New York City Subway'}))  # noqa

        self.assert_no_matching_feature(
            16, 19294, 24643, 'pois',
            {'kind': 'station', 'id': 2086974744})
    def test_rail(self):
        self.generate_fixtures(dsl.way(8920472, wkt_loads('LINESTRING (-122.39304153216 37.76442237615658, -122.392898520366 37.7639947225477, -122.392802041305 37.76360449179799, -122.392737632099 37.76319735713969)'), {u'tiger:name_base': u'Union Pacific Railroad', u'name': u'Peninsula', u'tiger:cfcc': u'B11', u'source': u'openstreetmap.org', u'electrified': u'no', u'operator': u'TransitAmerica Services', u'owner': u'Peninsula Joint Powers Board Railroad', u'tiger:county': u'San Francisco, CA', u'gauge': u'1435', u'usage': u'main', u'railway': u'rail', u'railway:traffic_mode': u'passenger'}))  # noqa

        self.assert_has_feature(
            16, 10487, 25333, "roads",
            {"kind": "rail", "kind_detail": "rail", "id": 8920472,
             "sort_rank": 382})
Ejemplo n.º 53
0
    def test_no_borough(self):
        # Node: Mount Pocono (158473043)
        self.generate_fixtures(
            dsl.way(
                158473043,
                wkt_loads('POINT (-75.36462806481801 41.12203367097907)'), {
                    u'gnis:ST_alpha': u'PA',
                    u'gnis:County_num': u'089',
                    u'name': u'Mount Pocono',
                    u'census:population': u'3001;2006',
                    u'gnis:ST_num': u'42',
                    u'import_uuid': u'bb7269ee-502a-5391-8056-e3ce0e66489c',
                    u'ele': u'562',
                    u'source': u'openstreetmap.org',
                    u'gnis:Class': u'Populated Place',
                    u'place': u'borough',
                    u'population': u'3001',
                    u'gnis:County': u'Monroe',
                    u'gnis:id': u'1181833',
                    u'is_in': u'Monroe,Pennsylvania,Pa.,PA,USA'
                }))  # noqa

        self.assert_no_matching_feature(16, 19048, 24541, 'places', {
            'kind': 'borough',
            'source': 'openstreetmap.org'
        })
    def test_crossover(self):
        self.generate_fixtures(dsl.way(119695339, wkt_loads('LINESTRING (-122.401795524772 37.70255026317898, -122.401807202871 37.7028924144261, -122.40181537754 37.70309056860139, -122.401826516649 37.7032822545431, -122.401834691318 37.70343989578041, -122.401847088069 37.70374565343717)'), {u'name_2': u'Union Pacific Railroad', u'name_1': u'Union Pacific Railroad', u'name': u'Caltrain', u'service': u'crossover', u'electrified': u'no', u'source': u'openstreetmap.org', u'gauge': u'1435', u'railway': u'rail'}))  # noqa

        self.assert_has_feature(
            16, 10485, 25347, "roads",
            {"kind": "rail", "kind_detail": "rail", "service": "crossover",
             "id": 119695339, "sort_rank": 357})