geolocation

Error adding geofences in Android (status code 1000)

╄→гoц情女王★ 提交于 2019-11-26 16:48:56
问题 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

Identify if point is in the polygon

半城伤御伤魂 提交于 2019-11-26 16:34:28
问题 As per my requirement, I am drawing polygons on google map shown in the image below.(using maps v2) Now I need to show an alert when user enters that particular polygons. How to identify if my current location is with in the polygon. (Need optimized way without draining battery) Thanks in advance. 回答1: Just tried Ray Casting algorithm which identifies point in polygon. This works perfect. Refer http://en.wikipedia.org/wiki/Point_in_polygon for thesis of Ray-Casting private boolean

Decoding the Google Maps embedded parameters

╄→гoц情女王★ 提交于 2019-11-26 16:16:08
问题 The context I would like to be able to extract the location of Google Maps embedded in a website (random example found at the bottom of this website). <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3128.340699934565!2d-0.46482818466529047!3d38.3642391796565!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0xd62377123a70817%3A0x85e89b65fcf7c648!2sCalle+Cruz+de+Piedra%2C+4%2C+03015+Alicante!5e0!3m2!1ses!2ses!4v1476192292052" width="100%" height="350" frameborder="0" style=

Determine timezone from latitude/longitude without using web services like Geonames.org

老子叫甜甜 提交于 2019-11-26 15:49:15
is there any possibility to determine the timezone of point (lat/lon) without using webservices? Geonames.org is not stable enough for me to use :( I need this to work in PHP. Thanks I had this problem a while back and did exactly what adam suggested: Download the database of cities from geonames.org convert it to a compact lat/lon -> timezone list use an R-Tree implementation to efficiently lookup the nearest city (or rather, its timezone) to a given coordinate IIRC it took less than 1 second to populate the R-Tree, and it could then perform thousands of lookups per second (both on a 5 year

how to redirect domain according to country IP address

社会主义新天地 提交于 2019-11-26 15:43:47
I made a site it with some subdomains; according to the country's IP address the user is supposed to be automatically redirected to corresponding subdomain. Example : Main site is abcd.com Suppose some one from India typed this url abcd.com, then the page redirects to ind.abcd.com Download the geoPlugin class from: http://www.geoplugin.com/_media/webservices/geoplugin.class.phps Put a index.php file in your root folder: <?php require_once('geoplugin.class.php'); $geoplugin = new geoPlugin(); $geoplugin->locate(); // create a variable for the country code $var_country_code = $geoplugin-

Get direction (compass) with two longitude/latitude points

六眼飞鱼酱① 提交于 2019-11-26 15:36:07
问题 I'm working on a "compass" for a mobile-device. I have the following points: point 1 (current location): Latitude = 47.2246, Longitude = 8.8257 point 2 (target location): Latitude = 50.9246, Longitude = 10.2257 Also I have the following information (from my android-phone): The compass-direction in degree, wich bears to the north. For example, when I direct my phone to north, I get 0° How can I create a "compass-like" arrow wich shows me the direction to the point? Is there a mathematic

Geospatial coordinates and distance in kilometers

淺唱寂寞╮ 提交于 2019-11-26 15:32:58
问题 This is a followup to this question. I seem to be stuck on this. Basically, I need to be able to convert back and forth to referring to coordinates either in the standard degree system OR by measuring a distance north from the south pole along the international date line, and then a distance east starting from that point on the date line. To do this (as well as some more general distance-measuring stuff), I have one method for determining the distance between two lat/lon points, and another

Best way to get geo-location in Java

我的梦境 提交于 2019-11-26 15:27:46
What is the best way to get geo-location in Java (freely if possible)? Update: Not from a GPS device. Basically how Firefox 3.5 / HTML 5 does it An easy way is with GeoLite ( http://dev.maxmind.com/geoip/legacy/geolite/ ). Because it uses a local database no web service calls are needed and it's much faster for geocoding large numbers of IPs. Here is how: Add this Maven artifact: <dependency> <groupId>com.maxmind.geoip</groupId> <artifactId>geoip-api</artifactId> <version>1.2.11</version> </dependency> Download the geolocation data file from http://geolite.maxmind.com/download/geoip/database

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

Check if a geopoint with latitude and longitude is within a shapefile

天涯浪子 提交于 2019-11-26 15:09:49
问题 How can I check if a geopoint is within the area of a given shapefile? I managed to load a shapefile in python, but can't get any further. 回答1: This is an adaptation of yosukesabai's answer. I wanted to ensure that the point I was searching for was in the same projection system as the shapefile, so I've added code for that. I couldn't understand why he was doing a contains test on ply = feat_in.GetGeometryRef() (in my testing things seemed to work just as well without it), so I removed that.