geolocation

How to know Geographic location from an IP address

不问归期 提交于 2019-11-27 15:25:12
问题 I have created a login application in jsp/servlet in my web project and I want to know about the geographic locations of different users those access my login page. How can I know that a person is accessing my login page from where? For example: If a person is accessing a page from Canada then a record will be inserted into my database such as : IP: 20.4.9.134 and location: Canada. 回答1: I use this: http://freegeoip.net/xml/122.169.8.137 Or http://www.geoplugin.net/xml.gp?ip=xx.xx.xx.xx Easy

MySQL - selecting near a spatial point

限于喜欢 提交于 2019-11-27 15:21:02
问题 I've based my query below to select points near a spatial point called point on the other SO solution, but I've not been able to get it to return any results, for the past few hours, and I'm a bit edgy now... My table lastcrawl has a simple schema: id (primary int, autoinc) point (spatial POINT) (Added the spatial key via ALTER TABLE lastcrawl ADD SPATIAL INDEX(point); ) $query = sprintf("SELECT * FROM lastcrawl WHERE MBRContains(LineFromText(CONCAT( '(' , %F + 0.0005 * ( 111.1 / cos(%F)) , '

FF 13, IE 9: JSON stringify / geolocation object

可紊 提交于 2019-11-27 15:07:12
I'm trying to get Firefox 13 to turn a geolocation position object into a JSON string, but it's returning an empty string rather than the correct string representation of my JSON object. This is working fine in the latest versions of Chrome and Safari, as well as the Android browser. Here's my code: if (navigator.geolocation) { navigator.geolocation.getCurrentPosition( function (position) { //Success handler console.log(position); //This outputs the position object to the console var gps = JSON.stringify(position); console.log(gps); //This outputs an empty string! }, function (error) { /

Android: getLastKnownLocation out-of-date - how to force location refresh?

こ雲淡風輕ζ 提交于 2019-11-27 14:58:25
问题 I'm using myLocation = mLocationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); to retrieve the current location at the start-up of my application. As the Android documentation states, this location can be "out-of-date", since the method returns the location when the GPS was used the last time. How can I actively request the current location from the GPS? I thought about using LocationListener , however that might be a bit of an overkill, since I only need the location once (at

Calculate the geo position at given time

痞子三分冷 提交于 2019-11-27 14:55:13
With Google API directions I can get all the information to go from one place to another and I can get all the steps as well. But I don't know if there is a way to retrieve/calculate the position(Lat/Lng) after a given time. Assuming, to simplify, my speed is constant is there I way to answer the question: where will I be in X minutes ? NOTE I know that Distance travelled = Time * Speed but in this way I know how many KM I travelled. What I want to know is the (Lat/Lng) after a period of time. working example using GetPointAtDistance from the epoly.js third party library from Mike Williams

html navigator “User denied Geolocation”

≯℡__Kan透↙ 提交于 2019-11-27 14:54:40
问题 I have an issue with window.navigator, I'm getting error code 1, "User denied Geolocation" whenever I run the following code as a local html file: navigator.geolocation.getCurrentPosition(function(position) { console.log(position); }, function(positionError) { console.log(positionError); }); The output is coming from the error function, positionError contains: code: 1 message: "User denied Geolocation" This does not happen if the containing html is served from some server. Is this expected?

Error adding geofences in Android (status code 1000)

雨燕双飞 提交于 2019-11-27 14:17:46
I am getting an error in the onAddGeofencesResult(int statusCode, String[] geofenceRequestIds) callback with statusCode = 1000 . I have my GPS enabled and my WiFi. I also have Google Play Services and I am able to track my location and request updates. Why am I not able to add geofences? I am not able to add geofences even from the documentation sample app. I get the following Toast message: "Add Geofences: Failure, error code 1000 GeofenceRequestIds=[1,2,1,2]" From the documentation (statusCode 1000): public static final int GEOFENCE_NOT_AVAILABLE Geofence service is not available now.

Ip address to country with database [closed]

旧城冷巷雨未停 提交于 2019-11-27 14:16:36
问题 I have downloaded ip-to-country.csv that has ip ranges that are mapped to countries. How should I store this data to database and how can I query in what range Ip address is to know where Ip address is coming from? 回答1: I wrote a small lib called ip2c to do just that. it uses the database from webhosting.info but also supports that from Software77. It converts the CSV info a compact binary format and can do the search straight on the file, in memory or in a memory mapped file. The Java API

Finding clients location in an ASP.NET page

柔情痞子 提交于 2019-11-27 14:14:44
问题 How to find clients location in my ASP.NET page? In fact I used System.Globalization.RegionInfo.CurrentRegion , but it is showing the setting in the control panel. So can I find the exact location using any method? 回答1: Not that it would give you 100% accuracy, but you can use hostip.info They provide an API that gives you the location of an IP address that you pass them via HTTP request. You can use a WebClient object to make calls to the API and parse the results. Scott Hanselman has a

Find nearest points with MySQL from points Table

佐手、 提交于 2019-11-27 14:10:58
问题 I have a DB Schema like this (from this tutorial by Google) - So the actual points in a graph for them is like this- What I want is to find points near a given point (by point_id ) point ordered by distance Location of a point (x,y) is ( point_x , point_y ) in DB I want to solve it with MySQL because my DB is already in MySQL. Update- Finding distance of 2 points is so easy like this- I want to sort on distance with MySQL. Re- For removing the confusions, I want the points inside the circle,