geolocation

CLLocation returning negative speed

ぐ巨炮叔叔 提交于 2019-11-28 03:03:57
问题 I'm starting a new app which uses the coreLocation and the mapkit frameworks. My problem is trying to get the current speed always returns me a negative value, i have take my iPhone with me to places with a good 3g signal and it doesn't matter, location.speed value is always -1. here is the code which matters: #define kRequiredAccuracy 1500.0 //meters #define kMaxAge 60.0 //seconds in the init method: self.locationManager=[[CLLocationManager alloc] init]; self.locationManager.delegate=self;

How to properly triangulate GSM cell towers to get a location?

怎甘沉沦 提交于 2019-11-28 02:48:30
First of all, I am trying to do all this disaster in c# (.net 4) so if you come up with some code to help me that would be appreciated but really anything would help at this point. I have a situation where I have a device that can only get GSM Cell information (incidentally via the AT+KCELL command) so I have a collection of values about cell towers (each has LAC, MCC, MNC, Cell ID, Signal Strength and the first Timing Advance). I think, therefore, I am in a good place to be able to come up with some sort of longitude and latitude coordinate (albeit inaccurate, but, well meh). This is where I

How to get a list of suburbs surrounding a location then repeat for other locations using MySql?

邮差的信 提交于 2019-11-28 02:18:00
I get a list of suburbs within a specified distance from a single location using Queries A . I’m trying to adapt Queries A to get a list of suburbs surrounding location1, then get list of suburbs surrounding location2 and so on (I'll call this Queries B ). Essentially Queries B is doing the same as Queries A, but repeating it for each separate location. My question- how can I do this using MySQL only. Suggestions on how to do this are much appreciated. Here is a sample of the data I am working with. SqlFiddle here CREATE TABLE `geoname` ( `geonameid` INT(11) NOT NULL, `asciiname` VARCHAR(200)

How to detect Location Provider ? GPS or Network Provider

拥有回忆 提交于 2019-11-28 02:13:39
问题 I'm using Fused Location Provider for location updates in my app. According to Fused Location Provided documentation, it uses all available resources (e.g. Wifi, GPS, Cell tower, etc..) to optimize location. But i want to know, is there any way to detect that current location update is from GPS Provider or Network provider, in Location update receiver ? 回答1: You can check the location provider by location.getProvider() from the location you are getting. Either you are using fused location api

Calculate total miles traveled from vectors of lat / lon

*爱你&永不变心* 提交于 2019-11-28 02:03:49
I have a data frame with data about a driver and the route they followed. I'm trying to figure out the total mileage traveled. I'm using the geosphere package but can't figure out the correct way to apply it and get an answer in miles. > head(df1) id routeDateTime driverId lat lon 1 1 2012-11-12 02:08:41 123 76.57169 -110.8070 2 2 2012-11-12 02:09:41 123 76.44325 -110.7525 3 3 2012-11-12 02:10:41 123 76.90897 -110.8613 4 4 2012-11-12 03:18:41 123 76.11152 -110.2037 5 5 2012-11-12 03:19:41 123 76.29013 -110.3838 6 6 2012-11-12 03:20:41 123 76.15544 -110.4506 so far I've tried spDists(cbind(df1

How to pass JavaScript values to JSF EL and backing bean?

旧巷老猫 提交于 2019-11-28 01:17:05
I am doing JSF geolocation service where I need to pass latitude and longitude to bean for processing. HTML5 allows getting location with JavaScript, for example like is done in http://code.google.com/p/geo-location-javascript/ . Putting following code to JSF page shows alert with GPS coordinates <script> if (geo_position_js.init()) { geo_position_js.getCurrentPosition(success_callback,error_callback,{enableHighAccuracy:true,options:5000}); } else { alert("Functionality not available"); } function success_callback(p) { alert('lat='+p.coords.latitude.toFixed(2)+';lon='+p.coords.longitude

Getting 0.0 for latitude and longitude while showing current location in map

隐身守侯 提交于 2019-11-28 01:16:41
I am using the following code to get my current location. But the problem I am facing is, it always returns 0.0 for latitude and longitude. I have turned on the GPS settings in the phone and set all the permissions. But still I am facing this. locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); customLocationListener = new CustomLocationListener(); locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, customLocationListener); class CustomLocationListener implements LocationListener{ ............ public void onLocationChanged(Location argLocation

JS Geolocation wait until success before return value

假如想象 提交于 2019-11-28 01:14:25
问题 I tried developing browser geolocation, but it seems geolocation quickly return a value when it is still searching for my location. Example of my script: function updateCoordinate() { navigator.geolocation.getCurrentPosition( function (position) { setTimeout(function() { var returnValue = { latitude: position.coords.latitude, longitude: position.coords.longitude } var serializeCookie = serialize(returnValue); $.cookie('geolocation', serializeCookie); return serializeCookie; }, 5000); },

Reverse geocoding to return results only in English?

旧城冷巷雨未停 提交于 2019-11-28 01:10:26
Using the code below I'm requesting a reverse geocoding for the current coordinate. Everything works great, except for when the device is set to a different language than English. Example: If the language of the device is Italian, and I'm in Italy, the result for country is "Italia" instead of "Italy". How can I force the results to be only in English, regardless of the language of the device? CLGeocoder *geoCoder = [[CLGeocoder alloc] init]; [geoCoder reverseGeocodeLocation:myCurrentLocation completionHandler:^(NSArray *placemarks, NSError *error) { for (CLPlacemark * placemark in placemarks)

In solr dih import two double in one location

混江龙づ霸主 提交于 2019-11-28 00:47:24
问题 What I have now is the two double filds: <field name="x_geo_x_coordinate" type="double" indexed="true" stored="true" default="0"/> <field name="x_geo_y_coordinate" type="double" indexed="true" stored="true" default="0"/> and what I want: the 2 double value in one location field: <field name="x_geo" type="location" indexed="true" stored="true" default="0.0,0.0"/> What I tried so far and does't work: <copyField source="*_coordinate" dest="x_geo"/> <copyField source="x_geo_str" dest="x_geo"/>