Questions tagged [geopy]

geopy allows you to convert between partial place names and latitude/longitude coordinates by wrapping many different online API's and providing access through one standard interface.

geopy allows you to convert between partial place names and latitude/longitude coordinates by wrapping many different online API's and providing access through one standard interface. Additionally, it contains convenience functions for parsing lat/long coordinates and finding as-the-crow-flies distance between them.

geopy makes it easy for developers to locate the coordinates of addresses, cities, countries, and landmarks across the globe using third-party geocoders and other data sources.

geopy includes support for many geocoders such as Google Maps, Bing Maps, Nominatim, and GeoNames.

504 questions
0
votes
1 answer

Instantiating geopy.geocoders.GoogleV3 with proxies causes exception

I am trying to call GoogleV3 geolocator like this: geolocator = GoogleV3(proxies={"http": "http://user:password@ip:port"}) address, (latitude, longitude) = geolocator.geocode('address to geocode') and it raises: AttributeError: OpenerDirector…
gwaramadze
  • 4,523
  • 5
  • 30
  • 42
0
votes
0 answers

Pandas: Efficient spatial analysis using adjacency matrix

I have a very large DataFrame with coordinates. Let's take the following example: df = pd.DataFrame({ 'Buyer': 'Carl Mark Carl Joe Mark Carl'.split(), 'Quantity': [5,2,5,10,1,5], 'Lat':[50.111, 48.777, 50.111, 52.523, 48.777, 50.111], 'Lng' :…
Andy
  • 9,483
  • 12
  • 38
  • 39
0
votes
2 answers

ERROR: "No JSON object can be decoded" in Geopy when extracting lat, long from geocode_url

I am using the following code: from geopy import geocoders def main(): gn = geocoders.GeoNames() city = 'roman' place, (lat, lng) =…
Parseltongue
  • 11,157
  • 30
  • 95
  • 160
0
votes
1 answer

" AttributeError: 'NoneType' object has no attribute 'split' " while installing geopy

I'm trying to install the packages from a requirements file for a django project. The problem is that while installing geopy I get the error AttributeError: 'NoneType' object has no attribute 'split'. I'm running within a virtualenv with python…
German
  • 113
  • 2
  • 6
0
votes
1 answer

Eclipse unresolved external with geopy

import csv from geopy import geocoders import time g = geocoders.Google() spamReader = csv.reader(open('locations.csv', 'rb'), delimiter='\t', quotechar='|') f = open("output.txt",'w') for row in spamReader: a = ', '.join(row) #exactly_one =…
Eae
  • 4,191
  • 15
  • 55
  • 92
0
votes
2 answers

GeocoderDotUS... Syntax of Python check for 'None'

import csv from geopy import geocoders import time g = geocoders.GeocoderDotUS() spamReader = csv.reader(open('locations.csv', 'rb'), delimiter='\t', quotechar='|') f = open("output.txt",'w') for row in spamReader: a = ', '.join(row) …
Eae
  • 4,191
  • 15
  • 55
  • 92
0
votes
1 answer

GeocoderDotUS Geopy ('NoneType' object is not iterable)

import csv from geopy import geocoders import time g = geocoders.GeocoderDotUS() spamReader = csv.reader(open('locations.csv', 'rb'), delimiter='\t', quotechar='|') f = open("output.txt",'w') for row in spamReader: a = ',…
Eae
  • 4,191
  • 15
  • 55
  • 92
0
votes
2 answers

Too many values to unpack with python CSV reader and Geopy

import csv from geopy import geocoders g = geocoders.Google() spamReader = csv.reader(open('locations.csv', 'rb'), delimiter='\t', quotechar='|') for row in spamReader: a = ', '.join(row) #print a place, (lat, lng) = g.geocode(a,…
Eae
  • 4,191
  • 15
  • 55
  • 92
-1
votes
1 answer

Combine two variables into list as one in list

I'm trying to measure distance through geopy. I have already gotten the latitude and longitude of the location with geopy but it's saved as individual variables. ie. getloc = loc.geocode(a) loclat = getloc.latitude loclon = getloc.longitude I…
-1
votes
1 answer

Tracing latitude and longitude using Python library

Can anyone guide me with the best location tracker ,to trace latitude and longitude using Python library. I am volunteering for not-for-profit ( Wild Life rescue) and eagerly trying to trace the exact location. My file has 2800 entries to trace the…
Amrutha
  • 3
  • 3
-1
votes
1 answer

Geopy Geocoders returns the correct results in one way, but not another

I'm trying to find the address of some universities. If I do this, everything is totally fine. import pandas as pd import numpy as np import pandas as pd from geopy.geocoders import Nominatim geolocator = Nominatim(user_agent='ryan-data') import…
ASH
  • 20,759
  • 19
  • 87
  • 200
-1
votes
1 answer

extract `state` from address using geopy

I have a table that has 10,000 address entries. I would like to obtain the full address from it and the state. How could I do it with geopy module? Other modules such as geopandas are not…
June
  • 335
  • 4
  • 15
-1
votes
1 answer

How parse address components returned by Nominatim reverse geocoding?

So, I'm working on a mapping application for geotagged images and I want include address information for the points of interest on my map. I have managed to successfully complete most of the task using Geopandas, GeoPy, and Nominatim with point data…
nizz0k
  • 471
  • 1
  • 8
  • 23
-1
votes
1 answer

Different data is being added to a file than is being printed in the console

I have been writing a program to get all the coordinates within a ten mile radius of any given point and when the distance data is printed its output is different from the data in the file. Not only this but it creates a blank line at the end of the…
Moose
  • 5
  • 4
-1
votes
1 answer

GeoPandas Polygon Coordinates Not Displaying Properly on Folium Map

This is the current code: import geopandas as gpd from shapely.geometry import Polygon lat_point_list = gdf['latitude'] lon_point_list = gdf['longitude'] polygon_geom = Polygon(zip(lon_point_list, lat_point_list)) crs = {'init':…
komskisp
  • 67
  • 1
  • 5