geolocation

TypeError received while trying to create Folium Colorline

TypeError received while trying to create Folium Colorline Question: I’m trying to create ColorLine for set of latitude and longitude coordinates. Code for the same is below, map_object = folium.Map(location=[15.235683, 75.167737], zoom_control=True, zoom_start = 10, control_scale=True) coordinates = [(15.564746,74.819551), (15.392602,75.173812),(15.392602,75.173812),(15.413797,74.735791)] color=[‘red’,’green’,’blue’] # should be of length len(coordinates) -1 line = features.ColorLine(coordinates,colors = color , weight= …

Total answers: 1

Folium initial map coordinates location not working

Folium initial map coordinates location not working Question: I’m using folium to plot some coordinates and every time I run the code it opens the map at some default coordinates instead of the ones I’ve defined. I tried: import folium import pandas as pd # includes only an example route, dict contains N keys with …

Total answers: 1

Using custom icons for multiple locations with Folium and Pandas

Using custom icons for multiple locations with Folium and Pandas Question: I am trying to iterate over a pandas dataframe to plot multiple geolocations on a Folium map using custom icons as markers instead of the default one. First I create a pandas dataframe as follows: # dependencies import folium import pandas as pd from …

Total answers: 1

Get geographical coordinates in a given square

Get geographical coordinates in a given square Question: My task is as follows: knowing the center (starting point), for example – [{‘lat’: -7.7940023, ‘lng’: 110.3656535}] and knowing the radius 5km I need to get all the points included in this square in 1 km increments. How do I achieve this? P.S Using the Haversine formula …

Total answers: 2

Extracting gps coordinates from image using Python

Extracting gps coordinates from image using Python Question: from PIL import Image from PIL.ExifTags import TAGS # path to the image or video imagename = "image.jpg" # read the image data using PIL image = Image.open(imagename) # extract EXIF data exifdata = image.getexif() # iterating over all EXIF data fields for tag_id in exifdata: # …

Total answers: 2

Plotly Scatter Points on Maps – Removing Longitude and Latitude from text

Plotly Scatter Points on Maps – Removing Longitude and Latitude from text Question: I am following this example very closely to experiment with plotting scatter points on maps and this is working perfectly: https://plot.ly/python/scatter-plots-on-maps/ However, when you hover over each scatter point you will notice the text is shown along with the latitude and longitude. …

Total answers: 2

How to decode geohash using python in pandas?

How to decode geohash using python in pandas? Question: I need code to decode geohash in python. There’s a column which contains geohashes. I need them decoded into latitude and longitude. Asked By: Saeed Ahmad || Source Answers: You can install pygeohash from pypi using pip $ pip install pygeohash Then add a new column …

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

Write Latitude and Longitude to Geotiff file

Write Latitude and Longitude to Geotiff file Question: I am basically trying to achieve the opposite of this question. I have a set of latitude and longitude coordinates (with values) in the WGS84 coordinate system, that I would like to write to a geotiff (or just add to a gdal dataset) via the gdal python …

Total answers: 2