latitude-longitude

How do I convert city names to time zones?

六眼飞鱼酱① 提交于 2020-01-05 07:07:08
问题 Sorry if this is repetitive, but I've looked everywhere and can't seem to find anything that addresses my specific problem in R. I have a column with city names: cities <-data.frame(c("Sydney", "Dusseldorf", "LidCombe", "Portland")) colnames(cities)[1]<-"CityName" Ideally I'd like to attach a column with either the lat/long for each city or the time zone. I have tried using the "ggmap" package in R, but my request exceeds the maximum number of requests they allow per day. I found the

How do I import an openstreetmaps shape file in R and extract lat/long centroids?

不问归期 提交于 2020-01-04 05:39:29
问题 I am trying to import an openstreetmaps shape file in R using the rgdal package. The shape file I downloaded has 5 components in it: places.cpg places.dbf places.prj places.shp places.shx The files can be accessed at the following location: https://drive.google.com/open?id=0B1ITb_7lHh1EUFVfVWc4ekRfSnc I have to do the following: 1) Import the shape file 2) Extract lat/long of the point or centroid of shape in case of polygon 3) Attach the lat/long pair to the dbf file to do some analysis I am

getpaths() polygons google maps api

我们两清 提交于 2020-01-03 14:37:42
问题 I am attempting to retrieve the latlng coordinates of both a polyline and polygon. After I complete the drawing of either object I would like to store the latlng in a database, but for now I am merely trying to show the latlng in a textarea. I have done this easily enough for markers, rectangles, and circles, but the terminology for polylines and polygons is baffling me. When I complete the drawing i use an addDomListener(drawingManager, 'polygoncomplete', ... for polyons and then iterate

Calculate min distance between a “line” and one “point”

只谈情不闲聊 提交于 2020-01-03 05:15:09
问题 I have a "linestring" (with init and end points) and a single "point" (two coordinates). And I have implemented the following ActionSctipt code to use "haversine formula" to calculate the distance between two points (each point has x & y coordinates); this function can return the "distance" in "kms", "meters", "feets" or "miles": private function distanceBetweenCoordinates(lat1:Number, lon1:Number, lat2:Number, lon2:Number, units:String = "miles"):Number { var R:int = RADIUS_OF_EARTH_IN_MILES

remove latitude and longitude fraction part after 6 digit

☆樱花仙子☆ 提交于 2020-01-02 08:01:29
问题 i get lat and long in this format Latitude23.132679999999997, Longitude72.20081833333333 but i want to in this format Latitude = 23.132680 and Longitude 72.200818 how can i convert 回答1: double Latitude = 23.132679999999997; int precision = Math.pow(10, 6); double new_Latitude = double((int)(precision * Latitude))/precision; This will give you only 6 digits after decimal point. 回答2: double d=23.132679999999997; DecimalFormat dFormat = new DecimalFormat("#.######"); d= Double.valueOf(dFormat

remove latitude and longitude fraction part after 6 digit

时间秒杀一切 提交于 2020-01-02 08:01:03
问题 i get lat and long in this format Latitude23.132679999999997, Longitude72.20081833333333 but i want to in this format Latitude = 23.132680 and Longitude 72.200818 how can i convert 回答1: double Latitude = 23.132679999999997; int precision = Math.pow(10, 6); double new_Latitude = double((int)(precision * Latitude))/precision; This will give you only 6 digits after decimal point. 回答2: double d=23.132679999999997; DecimalFormat dFormat = new DecimalFormat("#.######"); d= Double.valueOf(dFormat

Calculate Distance in Km and Miles

蹲街弑〆低调 提交于 2020-01-02 05:50:48
问题 I have two points whose latitude and longitude i know. How can i calculate the distance(in Km and Miles) between them. What is the formulae? 回答1: You can use the haversine formula to calculate such distances. 回答2: Use the haversine Formula for this... Here is the link having java script code to calculate distance http://www.movable-type.co.uk/scripts/latlong.html 回答3: A = LAT1, B = LONG1 C = LAT2, D = LONG2 (all converted to radians: degree/57.29577951) IF A = C AND B = D THEN DISTANCE = 0;

convert latitude and longitude to x and y grid system using python

十年热恋 提交于 2020-01-02 03:27:11
问题 I have file with latitude and longitude values, that i want to convert the x and y in km I want to measure the distance from each point. for instance I make the first points of latitude and longitude(which are 51.58, -124.6 respectfully) to (0,0) in my x and y system so than basically i want to find out what the other points are and their location from the origin so i want to find what 51.56(lat) -123.64(long) is in (x,y) in km and so on for the rest of the file. I want to do this all in

convert latitude and longitude to x and y grid system using python

人走茶凉 提交于 2020-01-02 03:27:08
问题 I have file with latitude and longitude values, that i want to convert the x and y in km I want to measure the distance from each point. for instance I make the first points of latitude and longitude(which are 51.58, -124.6 respectfully) to (0,0) in my x and y system so than basically i want to find out what the other points are and their location from the origin so i want to find what 51.56(lat) -123.64(long) is in (x,y) in km and so on for the rest of the file. I want to do this all in

identify which is the polygon from latitude and longitude

大憨熊 提交于 2020-01-02 03:12:10
问题 I have a map drawn using leaflet.js. If I give longitude and latitude value as input Can I identify the polygon? Can I get a client side script for this? 回答1: Got an answer as follows : //This is based on 'point in polygon algorithm' function getPoint () { float x=-89.82421875; //x and y represents the lat and lng values float y= 40.18307014852533; var a = boundaries; //the coordinates used to draw the map for (i = 0; i < a.features.length; i++) { PointInPolygon(x,y, a.features[i].geometry