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
2
votes
1 answer

Google Maps draw square despite projection

Im trying to draw a square grid on a google maps via android. If I measure out 250 meter by 250 meter distances on my python server using VincentyDistance in geopy, the resulting grid on the map is significantly rectangular instead of square. Id…
RedEyes
  • 35
  • 4
2
votes
1 answer

Pandas: Passing format options into functions

I want to extract coordinates from postcodes as a new df column. The functionality from the geopy module is: from geopy.geocoders import Nominatim geolocator = Nominatim() location = geolocator.geocode('%s tn6 3rn') print((location.latitude,…
RDJ
  • 4,052
  • 9
  • 36
  • 54
2
votes
1 answer

Export pandas dataframe with different data types to csv in python

I have a gps parameters data-frame with different types of data (integers, objects, floats, and strings) as follows: ID time speed pdop longitude latitude 0 356363050613605 2017-02-20T17:04:40 210 3.051 8.81640…
Mshendy
  • 303
  • 3
  • 11
2
votes
6 answers

Conversion of miles to latitude and longitude degrees using geopy

Background I want to add a model manager function that filters a queryset based on the proximity to coordinates. I found this blog posting with code that is doing precisely what I want. Code The snippet below seems to make use of geopy functions…
Belmin Fernandez
  • 8,307
  • 9
  • 51
  • 75
2
votes
1 answer

geopy TypeError : geocode() missing 1 required positional argument: 'query'

I am sorry if this is a too basic question however I am unable to understand a simple error that geopy is throwing at me. In [78]: import geopy In [79]:…
Peaceful
  • 4,920
  • 15
  • 54
  • 79
2
votes
1 answer

geopy does not show correct output

I am calculating latitudes and longitudes from zip code. I have installed geopy pip install geopy In my code: from geopy.geocoders import GoogleV3 def get_lat_lng(zip_code): lat, lng = False, False geocoder = GoogleV3() location =…
Usman Maqbool
  • 3,351
  • 10
  • 31
  • 48
2
votes
1 answer

Geopy using ArcGIS to geocode and solve for distance from a csv

I have a csv file with the following format Tampa Florida, Aarhus Denmark, Tampa Florida Tampa Florida, Aarhus Denmark, London England, Tampa Florida Each row is a trip and I need to calculate the total distance traveled from each trip. I figured I…
zackusf
  • 21
  • 1
2
votes
1 answer

Calling on a class

I'm using geopy and have a question on why an error is coming up. This code sample is from the one provided at github. It works as mentioned from geopy.geocoders import Nominatim geolocator = Nominatim() location =…
Leb
  • 15,483
  • 10
  • 56
  • 75
2
votes
1 answer

Geocoding error with geopandas and geopy

Per the geopandas docs I'm trying to geocode a list of strings, but I'm getting an error. My env import geopandas as gdp from geopandas.geocode import geocode import geopy import sys print(sys.version) print (gdp.__version__) print…
Bob Haffner
  • 8,235
  • 1
  • 36
  • 43
2
votes
2 answers

Geopy error: GeocoderServiceError: HTTP Error 500: Internal Server Error using pandas apply function with str concat

Working function (see code Python Pandas 'apply' returns series; can't convert to dataframe) has stopped working. Only difference is I'm passing it a string concatenation. # Get geocode, return LAT and LON def locate(x): geolocator =…
Harvey
  • 617
  • 8
  • 18
2
votes
1 answer

How to find if lat/long falls in an area using Django and geopy

I'm trying to create a Django app that would take an inputted address and return a list of political races that person would vote in. I have maps of all the districts (PDFs). And I know that I can use geopy to convert an inputted address into…
Wally
  • 523
  • 3
  • 6
  • 13
2
votes
1 answer

geopy distance get city python

I'm not sure this is possible but I have a list of coordinates of cities, then I would like take the first coordinate in the list and calculate it's distance for each coordinate in the list, finally I would like to get shortest distance and the city…
user2666310
  • 103
  • 2
  • 15
2
votes
0 answers

Service timed out using Bing's Maps API in Geopy

I am trying to use Bing's maps API with Geopy but every time I try to get some coordinates I have the "GeocoderTimedOUT" exception. g=geocoders.Bing('MY_KEY',timeout=5) place, (lat, lng) = g.geocode("British Museum ", True, None, None) print "%s:…
AritzBi
  • 197
  • 3
  • 10
2
votes
2 answers

how to query the database to return all zip codes with a given distance (ie 5 miles) from a given zip code using geopy

Hi frens I am using geopy to calculate the latitude and longitude. Now I want to get the list of areas given distance from a zipcode.How to get that?
RaviKiran
  • 753
  • 1
  • 6
  • 13
2
votes
1 answer

Efficient way to do spatial anaylsis with pandas

I am running into problems doing spatial analysis with a Panda's DataFrame. Right now I have a DataFrame with > 1000 rows and the columns "user", "latitude", "longitude". Based on this dataset I would like to do some spatial analysis such as…
Andy
  • 9,483
  • 12
  • 38
  • 39