def test_search_sequences(self): map = Mapillary(API_KEY) userkeys = "AGfe-07BEJX0-kxpu9J3rA" per_page = 1 raw_json = map.search_sequences(userkeys=userkeys, per_page=per_page) type_json = raw_json['type'] self.assertEqual("FeatureCollection", type_json)
map = Mapillary(key) #Used to name images i = 3261 image_resolution = 1024 for key_canton in gh_cantons.keys(): area_canton = 0 while area_canton < len(gh_cantons[key_canton]["suffix"]): gh_urban = gh_cantons[key_canton]["area_gh"] + gh_cantons[key_canton][ "suffix"][area_canton] #gh_urban = geohash_compl[area_canton] print(gh_urban) gh_box_map = convetBBoxtoMapillary(gh_urban) #we query sequences because we don't want many similar images in one area raw_json = map.search_sequences(bbox=gh_box_map, start_time=start_date) # every feature is a sequence of pictues sequence_list = raw_json["features"] for feature in sequence_list: image_keys = feature["properties"]["coordinateProperties"][ "image_keys"] coordinates = feature["geometry"]["coordinates"] image_angles = feature["properties"]["coordinateProperties"]["cas"] sequence_info = ','.join([ feature["properties"]["key"], feature["properties"]["captured_at"], str(feature["properties"]["pano"]) ]) i = register_entry(image_keys, coordinates, key_canton, i,
#!/usr/bin/env python # -*- coding: utf-8 -*- # This sample code searchs for sequences by the specified variables below. from pymapillary import Mapillary from pymapillary.utils import * # Every parameter that can be passed in to this search function # Plug and play as you please bbox = "16.430300,7.241686,16.438757,7.253186" # minx,miny,maxx,maxy end_time = "2016-03-14T13:44:37.206Z" #must be a valid ISO 8601 date per_page = 1 # default is 200 starred = "true" # or "false" it has to be lower cased start_time = "2016-03-14T13:44:37.206Z" #start_time" must be a valid ISO 8601 date userkeys = "AGfe-07BEJX0-kxpu9J3rA" usernames = "maning" #example user name map = Mapillary("insert client id here") raw_json = map.search_sequences(userkeys=userkeys, per_page=per_page) print(raw_json) # Download the beautified json for debugging return_json_file(raw_json, "../sample_json_output/search_sequences_example.json")