def run(self, input): self.status = 'complete' v = input.value[0] if isinstance(input.value, list) else input.value loc = location.geocode(v) if 'title' in v: loc[0]['title'] = v['title'] return ElementValue(type=self.get_output_type(), value=loc)
def run(self, input): self.status = 'complete' v = input.value[0] if isinstance(input.value, list) else input.value loc = location.geocode(v) if 'title' in v: loc[0]['title'] = v['title'] return ElementValue(type = self.get_output_type(), value = loc)
def create_result(data, itemsets_dry, itemsets_not_dry, section, sections_df): section_name = sections_df.loc[sections_df['odsek'] == section] day_of_a_week = dp.get_road_data( data.loc[data['stevilka_odseka'] == section]) keys = list(day_of_a_week.keys()) result_json[section] = {} result_json[section]['povrsje'] = {} result_json[section]['dan_teden'] = keys result_json[section]['kraj'] = section_name.values.tolist() result_json[section]['koordinate'] = [ location.geocode(str(section_name.iloc[0]['ime_odseka'])) ] create_json_element_surface(itemsets_to_list(itemsets_not_dry), data.columns, section, 'ne_suho') create_json_element_surface(itemsets_to_list(itemsets_dry), data.columns, section, 'suho')
def __init__(self, sense): self.sense = sense self.sense.load_image("img/iss.png") # Where are you ? self.position = location.locate() self.position_str = location.geocode(self.position) # Stations list self.stationList = StationList() self.selectStation('ISS (ZARYA)') # Print debug info # self.printAll() # Create root menu and display self.menu = Menu0(self) self.menu.start() self.menu.join()
def insertEntry(entryInfo): """ Connect to the PostgreSQL database server """ conn = None # connect to the PostgreSQL server print('Connecting to the PostgreSQL database...') conn = psycopg2.connect(DATABASE_URL, sslmode='require') # create a cursor cur = conn.cursor() insertUser = """INSERT INTO userInformation (netid, name, phone, email, description, address, city, latitude, longitude) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s) ON CONFLICT (netid) DO UPDATE SET (name, phone, email, description, address, city, latitude, longitude) = (EXCLUDED.name, EXCLUDED.phone, EXCLUDED.email, EXCLUDED.description, EXCLUDED.address, EXCLUDED.city, EXCLUDED.latitude, EXCLUDED.longitude);""" name = entryInfo.getName() netid = entryInfo.getNetid() phone = entryInfo.getPhone() email = entryInfo.getEmail() address = entryInfo.getAddress() description = entryInfo.getDescription() city = entryInfo.getCity() coordinates = geocode(str(address)) latitude = None longitude = None if (coordinates is not None): offcoordinates = coordinateOffset(coordinates[0], coordinates[1]) latitude = float(offcoordinates[0]) longitude = float(offcoordinates[1]) cur.execute(insertUser, (netid, name, phone, email, description, address, city, latitude, longitude)) conn.commit() conn.close() print('success') print('Database connection closed.')
print('\n') import location # iOS location information library if location.is_authorized(): location.start_updates( ) # start checking for location information, may speed up response to ‘get_location()’ print(location.get_location()) address = { 'Street': 'Victoria Gardens Blvd', 'City': 'Port Orange', 'Country': 'USA' } result = location.geocode(address) print("Port Orange: " + str(result)) print("Reverse geocode: " + str(location.reverse_geocode(location.get_location()))) location.stop_updates() # stop checking the current location print('\n') import clipboard text = clipboard.get() print("Clipboard Data: " + str(text))
def printStationLoc(self): self.sense.show_message( "Is over: " + location.geocode(self.station.position, "country"))