Esempio n. 1
0
def test_tilequery_with_radius_limit_dedupe_geometry_and_layers():
    add(
        method=GET,
        url="https://api.mapbox.com" + "/v4" + "/mapbox.mapbox-streets-v8" +
        "/tilequery" + "/0.0,1.1.json" + "?access_token=pk.test" +
        "&radius=25" + "&limit=25" + "&dedupe=true" + "&geometry=linestring" +
        "&layers=layer0,layer1%2Clayer2",
        match_querystring=True,
        body='{"key": "value"}',
        status=200,
    )

    tilequery = Tilequery(access_token="pk.test")

    response = tilequery.tilequery(
        "mapbox.mapbox-streets-v8",
        lon=0.0,
        lat=1.1,
        radius=25,
        limit=25,
        dedupe=True,
        geometry="linestring",
        layers=["layer0", "layer1", "layer2"],
    )

    assert response.status_code == 200
Esempio n. 2
0
def test_tilequery_one_mapid():
    add(
        method=GET,
        url="https://api.mapbox.com" + "/v4" + "/mapbox.mapbox-streets-v8" +
        "/tilequery" + "/0.0,1.1.json" + "?access_token=pk.test",
        match_querystring=True,
        body='{"key": "value"}',
        status=200,
    )

    tilequery = Tilequery(access_token="pk.test")

    response = tilequery.tilequery("mapbox.mapbox-streets-v8",
                                   lon=0.0,
                                   lat=1.1)

    assert response.status_code == 200
Esempio n. 3
0
def test_tilequery_with_radius_and_geometry():
    add(
        method=GET,
        url="https://api.mapbox.com" + "/v4" + "/mapbox.mapbox-streets-v8" +
        "/tilequery" + "/0.0,1.1.json" + "?access_token=pk.test" +
        "&radius=25" + "&geometry=linestring",
        match_querystring=True,
        body='{"key": "value"}',
        status=200,
    )

    tilequery = Tilequery(access_token="pk.test")

    response = tilequery.tilequery("mapbox.mapbox-streets-v8",
                                   lon=0.0,
                                   lat=1.1,
                                   radius=25,
                                   geometry="linestring")

    assert response.status_code == 200