geolocation

Maxmind geolocation apis: Apache vs PHP

蓝咒 提交于 2019-12-11 03:49:46
问题 I am looking to implement a very basic country limiting on my site based on the Maxmind geoip database (free version). Basically, I want to limit all users of the site to one country only. What I'm wondering is: is there any performance gain using the Apache API versus the PHP API? I want to be able to use the country code for more than just a simple redirect (display messages in different languages, etc.), so that's why I'm leaning toward PHP, but my number one concern is the impact on

how to optimize a geolocation database in mysql for euclidean distance search/query

ⅰ亾dé卋堺 提交于 2019-12-11 03:49:20
问题 i am using mysql to store geolocation data. i would like to know how to optimize the table holding the (x,y) coordinates so that queries will be optimized against it. (the x,y will be lat/long). for example, i have a table with the following fields: id, x, y, notes. at sometime later, i will perform a query: select * from geoloc where sqrt( (x-@x)^2 + (y-@y)^2 ) < delta please note, i have no idea how the actual SQL statement will work right now, so the above is just a very rough idea of what

Android- Google Maps V2 : Trace route from current position to an other destination

梦想的初衷 提交于 2019-12-11 03:37:25
问题 I started with this example, to draw a route between 2 address, type by the user. It is working. http://blog.rolandl.fr/1357-android-des-itineraires-dans-vos-applications-grace-a-lapi-google-direction But now I would like to draw a route from my current position to an other destination, type by the user. My problem is that I don't know how to retrieve the current position, in this case. I've tried to do : LocationManager locationmanager=(LocationManager)this.getSystemService(LOCATION_SERVICE)

How can I find users near the current user's location using Parse?

时光怂恿深爱的人放手 提交于 2019-12-11 03:34:37
问题 My app needs to find the user's current location, which I have done. Then it needs to find other users that are near the current user's location. I am using Parse for this. So far this is what I have to get the user's current location and it is working so far.I don't understand how to find the other user near the current user's location though. Can someone please help me out? I'd really appreciate it. if ([PFUser currentUser] && [PFFacebookUtils isLinkedWithUser:[PFUser currentUser]]) { [self

Geolocation and Haversine formula

╄→гoц情女王★ 提交于 2019-12-11 03:19:06
问题 I am trying to create a basic web application that detects the users geolocation, queries a mySQL database, and returns all bus stops within say 5 kilometers. The GTFS feed including the Longitude and Latitude have been inserted into a mySQL database, and I found a example HTML page that provides the Longitude and Latitude of the browser accessing the web application. I am seeking some help writing the mySQL query that takes this information and returns the results. 回答1: Although the great

Redirect main website to sub domain based on visitor IP address (country)

↘锁芯ラ 提交于 2019-12-11 02:07:35
问题 I need help redirecting my website to sub domain based on visitor ip address (location). I have 3 specific websites I want to redirect visitors from Europe to eu.mysite.com I want to redirect visitors from USA to us.mysite.com I want to redirect visitors from rest of the world to mysite.com I tried several codes and modifying htaccess as well, it didn't help as GeoIp not installed on the server. 回答1: You just use an API to resolve the visitor continent by IP and redirect to the corresponding

Cordova geolocation plugin doesn't work on android

与世无争的帅哥 提交于 2019-12-11 02:02:59
问题 I'm using cordova ,geolocation plugin for showing latitude and longitude on android. There are plenty of question same as this so I read and tried their solution but couldn't fix the problem. The code below works perfectly on browser. I tried 3 method, first: "navigator.geolocation.watchPosition" which returns wrong result(37.42,-122.08) in emulator(Android Studio) and doesn't return anything in device. I also tried "navigator.geolocation.getCurrentPosition" with both "enableHighAccuracy" set

Direction of target annotation when outside of visible area

跟風遠走 提交于 2019-12-11 01:55:34
问题 I would like to show the direction images on all sides of the screen. E.g. if the target's location is the right side of user's location and is outside of the visible map area, then I want to add a direction image as shown on the picture below (The Green annotation is user's location, red one is the direction for the target, which is out of bounds of the screen): What is the standard approach to do this? 回答1: The simplest way is to place four "pointer" views above the map at each of the

Efficiently compute pairwise haversine distances between two datasets - NumPy / Python

限于喜欢 提交于 2019-12-11 01:30:38
问题 I want to calculate the geo-distance between latitude-longitude. I had checked this thread Vectorizing Haversine distance calculation in Python but when I am using it for two different set of coordinates, I m getting an error. df1 size can be in millions and if there is any other way to calculate accurate geo distance in less time then it would be really helpful. length1 = 1000 d1 = np.random.uniform(-90, 90, length1) d2 = np.random.uniform(-180, 180, length1) length2 = 100 d3 = np.random

How do you implement “follow me” using the MyLocationOverlay class?

半城伤御伤魂 提交于 2019-12-11 00:54:22
问题 I made an application which shows the current location of the user using the MyLocationOverlay class. However, when the user changes his location, the marker is not recentered. How do I implement the "follow me" feature? I am thinking of making the LocationManager to update as frequently as possible and then calling the animateTo method inside the onLocationChanged method but it seems to be a bad solution. Is there any way of doing it? 回答1: What I do is extend MyLocationOverlay as an inner