google-maps

Calculate the distance like the Google Maps in longitude and latitude origin and longitude and latitude final

Calculate the distance like the Google Maps in longitude and latitude origin and longitude and latitude final Question: I have the follow df with the columns: lati_origin longi_oringin lati_final longi_final -19.864315 -44.047180 -3.026643 -59.955860 I used the follow function, but don’t return the same distance in km of Google Maps. def haversine_np(lon1, lat1, lon2, lat2): …

Total answers: 1

Collecting places using Python and Google Places API

Collecting places using Python and Google Places API Question: I want to collect the places around my city, Pekanbaru, with latlong (0.507068, 101.447777) and I will convert it to the dataset. Dataset (it contains place_name, place_id, lat, long and type columns). Below is the script that I tried. import json import urllib.request as url_req import …

Total answers: 2

Show location of coordinates on google maps using Python

Show location of coordinates on google maps using Python Question: I wrote a code for data science and I got some coordinates that I want to plot on google maps. These are the coordinates, and all of these coordinates are in capitol city of Serbia called Belgrade. X Y 20.657460 44.490140 20.510760 44.652443 20.510540 44.884460 …

Total answers: 2

Plot latitude longitude from CSV in Python 3.6

Plot latitude longitude from CSV in Python 3.6 Question: I’m trying to plot a large number of latitude longitude values from a CSV file on a map, having this format (first column and second column): I’m using python 3.6 (apparently some libraries like Basemap doesn’t operate on this version). How can I do that? Asked …

Total answers: 3

Calculate distance between 2 points in google maps using python

Calculate distance between 2 points in google maps using python Question: I get longitude and latitude using gmail geocode function. Now i need to calculate distance between 2 points. I found Haversine formula and it works well, but then in google js api i found method computeDistanceBetween(lat,lng) in the Geometry Library. My question is there …

Total answers: 4

How can I generate a regular geographic grid using python?

How can I generate a regular geographic grid using python? Question: I want to retrieve all lat/lon coordinate pairs of a regular grid over a certain map area. I have found the geopy library, but didn’t manage at all to approach the problem. For example, I have a rectangular geographic area described by its four …

Total answers: 1

JSON to pandas DataFrame

JSON to pandas DataFrame Question: What I am trying to do is extract elevation data from a google maps API along a path specified by latitude and longitude coordinates as follows: from urllib2 import Request, urlopen import json path1 = ‘42.974049,-81.205203|42.974298,-81.195755’ request=Request(‘http://maps.googleapis.com/maps/api/elevation/json?locations=’+path1+’&sensor=false’) response = urlopen(request) elevations = response.read() This gives me a data that looks …

Total answers: 14

Map of all points below a certain time of travel?

Map of all points below a certain time of travel? Question: My question is very simple and can be understood in one line: Is there a way, tool, etc. using Google Maps to get an overlay of all surface which is below a certain time of travel? I hope the question is clear, but I …

Total answers: 6

Capture embedded google map image with Python without using a browser

Capture embedded google map image with Python without using a browser Question: I have noticed that, from Google Maps page, you can get an “embed” link to put inside an iframe and load the map in a browser. (no news here) The image size can be adjusted to be very large, so I am interested …

Total answers: 8