latitude-longitude

Check if a latitude and longitude is within a circle

試著忘記壹切 提交于 2019-11-26 18:00:31
问题 See this illustration: What I would like to know is: How to create an area (circle) when given a latitude and longitude and the distance (10 kilometers) How to check (calculate) if a latitude and longitude is either inside or outside the area I would prefer if you can give me code example in Java or specifically for Android with Google Maps API V2 回答1: What you basically need, is the distance between two points on the map: float[] results = new float[1]; Location.distanceBetween

Passing strings between activities in android

。_饼干妹妹 提交于 2019-11-26 17:51:36
I have searched quite a few places but i haven't got up with any good solution that worked yet, and i really need help! I am making an application that needs to pass a longitude and latitude string from one activity to another. How can i do this??? Take a look at my code here: The LocationActivity.java needs to pass the string to the other activity and to another one that i didn't paste into here. And the string that needs to be passed is named: "latLongString" LocationActivity.java: import android.R.string; import android.app.Activity; import android.content.Context; import android.content

How do you click on a map and have latitude and longitude fields in a form populated?

為{幸葍}努か 提交于 2019-11-26 16:36:53
问题 I have a form that a user needs to fill out where the location needs to be identified. I have latitude and longitude input fields on the form. I am also looking for the decimal lat and long. What I would like seems really simple. I just want to have a link that the user can click on that would popup a map (google or yahoo) and he could use the map to find the location and just click on it and that would automatically populate the two input fields for lat and long from the map. Has anyone done

Maximum Lat and Long bounds for the world - Google Maps API LatLngBounds()

萝らか妹 提交于 2019-11-26 15:24:13
问题 The Google Maps terrain view by default has unlimited panning of the map tile. You can use LatLngBounds() to limit this, but what are the maximum and minimum coordinates I should use to set the viewport as just the earth and not outside the map region? Coordinates for North America: var strictBounds = new google.maps.LatLngBounds( new google.maps.LatLng(28.70, -127.50), new google.maps.LatLng(48.85, -55.90) ); I've tried (+90, -180)(-90,180) to no luck. 回答1: The links provided by @Marcelo &

Determine if one coordinate is in radius of another

≡放荡痞女 提交于 2019-11-26 15:19:50
问题 Let's say I have a Table of rows that contain coordinates. What would be the best way to pull only the rows of coordinates which are in the radius of another coordinate? To simplify my question, I'm giving the following example: Table like: Columns: Latitude, Longitude. Row1: 23.44444 24.55555 Row2: 32.44444 28.22222 Row3: 35.11111 32.12345 In an SQL statement, how do I get the rows of coordinates that are in the radius of Row3 for example? 回答1: This post shows how to do this in SQL Server.

Longitude and latitude value from IP address

久未见 提交于 2019-11-26 15:16:48
问题 Is it possible to get the longitude and latitude value from IP address in asp.net? If it is possible, please let me know how can I get this. 回答1: MaxMind Geolite city is free . If it is not good enough, you can apparently upgrade to a more accurate paid-version. I can't speak for the quality of the paid version, as I have never used it. If you like your SQL, download the CSV version. Load it into your database of choice, and query away. The faster and space-efficient option is to download the

Find distance between two points using latitude and longitude in mysql

♀尐吖头ヾ 提交于 2019-11-26 14:27:24
Hi I have the following table -------------------------------------------- | id | city | Latitude | Longitude | -------------------------------------------- | 1 | 3 | 34.44444 | 84.3434 | -------------------------------------------- | 2 | 4 | 42.4666667 | 1.4666667 | -------------------------------------------- | 3 | 5 | 32.534167 | 66.078056 | -------------------------------------------- | 4 | 6 | 36.948889 | 66.328611 | -------------------------------------------- | 5 | 7 | 35.088056 | 69.046389 | -------------------------------------------- | 6 | 8 | 36.083056 | 69.0525 | ------------------

How do I know if a Lat,Lng point is contained within a circle?

情到浓时终转凉″ 提交于 2019-11-26 13:08:12
问题 Ok pretty self explanatory. I\'m using google maps and I\'m trying to find out if a lat,long point is within a circle of radius say x (x is chosen by the user). Bounding box will not work for this. I have already tried using the following code: distlatLng = new google.maps.LatLng(dist.latlng[0],dist.latlng[1]); var latLngBounds = circle.getBounds(); if(latLngBounds.contains(distlatLng)){ dropPins(distlatLng,dist.f_addr); } This still results in markers being places outside the circle. I\'m

Get latitude and longitude based on location name with Google Autocomplete API

↘锁芯ラ 提交于 2019-11-26 12:53:44
问题 I have a textbox in my page which gets a location name and button with text getLat&Long . Now on clicking my button I have to show an alert of latitude and longitude of the location in the textbox. Any suggestion? 回答1: You can use the Google Geocoder service in the Google Maps API to convert from your location name to a latitude and longitude. So you need some code like: var geocoder = new google.maps.Geocoder(); var address = document.getElementById("address").value; geocoder.geocode( {

Calculate distance given 2 points, latitude and longitude [duplicate]

廉价感情. 提交于 2019-11-26 12:26:42
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: MySQL latitude and Longitude table setup I know this question has probably been asked many times, I\'ve researched a lot and I need help with specific thing. Lets say I have a form and user enters longitude and latitude, and I have a database which has table containing longitudes and latitudes, how would I search for a point or points in that table that are within 15 miles of radius? 回答1: You can use the formula