latitude-longitude

Distance between two lat,lon points

送分小仙女□ 提交于 2019-12-07 02:05:23
问题 Is it ok to compare distances in a classic way (distance between 2 points: d = sqrt(pow(lat2-lat1, 2) + pow(lon2-lon1, 2)) ) using the latitude and longitude returned from google apis without any transformation to meters or sth? I need it just for a comparison to find the closest point from a series of points to a reference point. For example: Lets say we have two (lat,lon) points: (40.2535425,22.88245345) and (40.2565795,22.8884539) and we want to find witch is closest to (40.2335425,22

Google Maps Android API v2 detect long press on map and add marker not working

戏子无情 提交于 2019-12-06 18:49:57
问题 I want to add a marker on map with long press. Toast in onMapClick() was display with normal tap. But long press is not working. Toast in onMapLongClick() is not displayed with long press. Also marker is not displayed on map. I'm using SupportMapFragment because I want to use my application on Android 2.x devices. I have tested my app on Nexus One which has Android version 2.3.7. This is my code. public class MainActivity extends FragmentActivity implements OnMapClickListener,

How to get the current Location name as a string , when we know the latitude and longitude [duplicate]

a 夏天 提交于 2019-12-06 16:00:19
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to retrieve user's current city name? using the following methods i am getting latitude and longitude of the current position - (void)viewDidLoad { [super viewDidLoad]; locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m

lat/lon conversion to x/y-coordinates

纵饮孤独 提交于 2019-12-06 15:05:01
I have a openstreetmap image. left upper corner is lat: 80 lon: -169 and right lower corner is lat:-56 lon: 190 The image has the width: 2618 and the height: 1513 How do I convert given lat/lon-coordinates to the pictures x/y-coordinates? I tried it by myself, but couldn't figure out how to convert the coordinates. I hope someone can answer my question. The question, as asked, is almost nonsensical. The area requested covers almost the entire globe, from 80N 169W to 56S 190E. That leaves out the band pole to pole from 170W to 169W, a disk around the north pole north of 80N, and a larger disk

How to prompt user for place using Google Maps in javascript?

送分小仙女□ 提交于 2019-12-06 15:02:53
问题 I am new to Google Maps and still new to Javascript. I need to have a user select a location on a map (using Google Map) and retrieve the corresponding town, country, latitude and longitude. If timezone is available too, that would be great. I can't find an operational code example. Does anyone have one to share? Thanks. 回答1: The sample code provided by Google at http://code.google.com/apis/maps/documentation/javascript/examples/event-arguments.html gets a LatLng from a mouse click and puts a

PHP Latitude Longitude to Address

久未见 提交于 2019-12-06 14:58:42
问题 I have a form on my website where a user enters an address of a place. When they submit the form, I convert this location into latitude/longitude and store this in a MySQL Database. I am using Google's Geocode service for this conversion. The problem is that I can't find either a class or a service to convert that latitude/longitude back to an address and as far as I know, Google's Geocode service is a unidirectional conversion. I realize I could store the physical address in the database,

Converting GPS coordinates (latitude and longitude) to decimal

笑着哭i 提交于 2019-12-06 14:26:12
I am getting the latitude and longitude from GPS device. They look like 21081686N,079030977E If I manually convert them to 21°08'16.86"N, 79°03'09.77"E and check on Google maps, the location is almost correct. How do I convert these values in java and convert them to decimal accurately? Any JAVA libraries? Thanks, acraig5075 You shouldn't need a library, but rather just break up the strings into their component parts. Perhaps this will help. Please note I'm not a Java programmer so this syntax could very well be wrong. (Perhaps retag your question to Java) By decimal I presume you mean decimal

a failed attempt at placing a dot over an image based on known lat and lng points

主宰稳场 提交于 2019-12-06 13:33:36
I apologize for the vague title, I really can't figure out a batter way to sum it up. Suggestions are more than welcome. I'm working on a project that really doesn't NEED a google map, it'd just create extra overhead for this project. But, I can't figure out how to do this WITHOUT google maps... so far. If I were to place a graphical overlay of a floor plan into google maps, I could use a browser location to approximate a users position. For this, it's a VERY large place, so there's room for some poor accuracy. Now what I'm trying to do is knowing the bounding of that overlay, place the image

Get latitude and longitude points along a line between two points, by percentage

a 夏天 提交于 2019-12-06 12:54:30
问题 In the image below, you can see that there 3 lines drawn from one point (the black circle) to its 3 related points (). IMAGE QUESTION How to calculate latitude and longitude point between points along each line, using a percentage of the distance between the two points? For example, if I wanted to get the position to be able to draw additional circles along each line with a 20% difference? WHAT CODE I HAVE NOW var data = [ { "coords" : [ 53.409045, -2.985406 ]}, { "coords" : [ 53.408747, -2

getting current location longitude and latitude in android

安稳与你 提交于 2019-12-06 12:52:38
问题 THis is my location class with this i am getting location longitude and latitude, but my problem is if i change my current location the longitude and latitude values are not updating. if i store my home location in my device, then my app is taking every time the same longitude and latitude values it is not taking my current location details. ex: I was in new york today and I launched a app and the location was my home in new jersey. public class GetLocation extends Activity { protected