geolocation

What's the simplest way to get a user's latitude and longitude from an ip address [closed]

六月ゝ 毕业季﹏ 提交于 2019-11-27 04:15:55
问题 I always end up needing the user's location on most web projects that I work on. I've used Maxmind's GeoIp, but it involves you importing their dataset and it needs constant updating. There are also other free and paid services, but I just wanted something simple that I could add to any site in a matter of seconds. So this is sort of baited because I have a simple solution, detailed below, but I wanted to see if anyone else uses this technique and if there are any better solutions or if there

Google maps - how to get building's polygon coordinates from address?

陌路散爱 提交于 2019-11-27 04:15:36
问题 How to implement the following: User defines an address User defines a color Service searches for a corresponding building on the google map Service fills the found building on the map with the color I know how to: 1.find lat/long of the address 2.draw the polygon So, to do the task I need to get polygon coordinates of building from address. How to? 回答1: (1) Acquire image tile (2) Segment buildings based on pixel color (here, 0xF2EEE6). (3) Image cleanup (e.g. erosion then dilation) +

FF 13, IE 9: JSON stringify / geolocation object

瘦欲@ 提交于 2019-11-27 04:06:19
问题 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 =

Network location provider not giving location android

大憨熊 提交于 2019-11-27 03:49:45
问题 I am developing a small android application in which I want to find out the user's current location by using the network provider. I tried this in following ways but it's not giving me any output : networklocationManager = (LocationManager) this .getSystemService(Context.LOCATION_SERVICE); // Define a listener that responds to location updates LocationListener networklocationListener = new LocationListener() { public void onLocationChanged(Location location) { Log.i("*************************

R convert zipcode or lat/long to county

穿精又带淫゛_ 提交于 2019-11-27 03:46:10
I have a list of locations that contains a city, state, zip, latitude and longitude for each location. I separately have a list of economic indicators at the county level. I've played with the zipcode package, the ggmap package, and several other free geocoding websites including the US Gazeteer files, but can't seem to find a way to match the two pieces. Are there currently any packages or other sources that do this? screechOwl I ended up using the suggestion from JoshO'Brien mentioned above and found here . I took his code and changed state to county as shown here: library(sp) library(maps)

MongoDB Stored Procedure Equivalent

馋奶兔 提交于 2019-11-27 03:29:15
I have a large CSV file containing a list of stores, in which one of the field is ZipCode. I have a separate MongoDB database called ZipCodes, which stores the latitude and longitude for any given zip code. In SQL Server, I would execute a stored procedure called InsertStore which would do a look up on the ZipCodes table to get corresponding latitude and longitude and insert the data into the Stores table. Is there something similar to the concept of stored procedures in MongoDB for this? Basically, for each insert I need to look up the latitude and longitude for that store and save that as

In new chrome (44.0.2403.157) geolocations doesnt works

混江龙づ霸主 提交于 2019-11-27 03:24:42
问题 Its seems like in new chrome version on MacOs on Linux Mint and on Windows geolocations doesnt works! Its returns error: "ERROR(2): Network location provider at 'https://www.googleapis.com/' : Returned error code 403." Does anyone has same problem? 回答1: Must be a bug in the latest version of Chrome, also happens in the page of Google Maps API: https://developers.google.com/maps/documentation/javascript/examples/map-geolocation Hopefully it will be fixed fast. Edited: Try now, it works :) 回答2:

How can I find a user’s country using HTML5 geolocation?

点点圈 提交于 2019-11-27 03:24:21
I'm familiar with HTML5 geolocation for returning rough coordinates of the user’s location. However, how can I return the name of the country that their coordinates are in? var geocoder = new google.maps.Geocoder(); geocoder.geocode({'latLng': <YOURLATLNGRESPONSEFROMGEO>}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[0]) { var loc = getCountry(results); } } }); function getCountry(results) { for (var i = 0; i < results[0].address_components.length; i++) { var shortname = results[0].address_components[i].short_name; var longname = results[0].address

onLocationChanged is not called automatically

泄露秘密 提交于 2019-11-27 03:23:10
问题 I have a problem with onLocationChanged event in Android. Here's the triggering: case R.id.start: { Points.add(overlay.getMyLocation()); // Points' type is ArrayList<GeoPoint> mgr.requestLocationUpdates(best, 0, 3, locationListener); } break; And here's the onLocationChanged method: public void onLocationChanged(Location location) { i++; Points.add(overlay.getMyLocation()); MapOverlay mapOverlay = new MapOverlay(Points.get(i-1), Points.get(i)); map.getOverlays().add(mapOverlay); //does the

Reading the GPS data from the image returned by the camera in iOS iphone

不羁岁月 提交于 2019-11-27 03:21:07
I need to get the GPS coordinates of an image taken with the iOS device's camera. I do not care about the Camera Roll images, just the image taken with UIImagePickerControllerSourceTypeCamera. I've read many stackoverflow answers, like Get Exif data from UIImage - UIImagePickerController , which either assumes you are using the AssetsLibrary framework, which doesn't seem to work on camera images, or use CoreLocaiton to get the latitude/longitude from the app itself, not from the image. Using CoreLocation is not an option . That will not give me the coordinates when the shutter button was