proximity

Order table by proximity to specific latitude/longitude (using MySQL+PHP)

一曲冷凌霜 提交于 2019-12-04 11:26:53
问题 MySQL (table) id | url | lat | lng ---------------------------------- 1 | x | 44.339565 | -101.337891 ---------------------------------- 2 | y | 44.150681 | -101.074219 ---------------------------------- 3 | z | 43.897892 | -100.634766 what I want to do now is order the list according to their proximity to (43.834527,-99.140625). $a = mysql_query("SELECT * FROM table ORDER BY proximity DESC"); while($b = mysql_fetch_assoc($a)) { echo $b['url'].'<br />'; } 回答1: You may be interested in

How best to perform corridor range search over a set of latitude / longitude coordinates

纵然是瞬间 提交于 2019-12-04 10:02:45
What would be the best approach to finding the set of coordinates, from say about 5,00, which lie within a path of points, given a specified width. eg an aircraft following several waypoints. Is there a good way to also sort them in the same order as the route. Calculation speed would be more important than accuracy, since I'm looking at producing a list of suggestions. From what I've looked at, I presume it's not straightforward, and the question is a bit broad, but any suggestions/pointers would be welcome, eg for: Best way to store lat / long, or use spherical coordinates Having additional

Proximity sensor in Swift (from Objective-C)

落爺英雄遲暮 提交于 2019-12-04 08:27:44
I'm a relatively new user to swift and now, I need to take advantage of the proximity sensor of an iPhone. I don't matter the distance, but I want to know when something is near the iPhone. So I found this code in Objective-C that worked, but I need it in Swift. I have tried some ways, but any worked. So here is the code I need: - (void) activateProximitySensor { UIDevice *device = [UIDevice currentDevice]; device.proximityMonitoringEnabled = YES; if (device.proximityMonitoringEnabled == YES) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(proximityChanged:) name:@

Elasticsearch complex proximity query

夙愿已清 提交于 2019-12-04 07:44:54
Given that I have a query like below: council* W/5 (tip OR tips) The above query can be translated as: Find anything that has council* and (tip OR tips) no more than 5 words apart. So following text will match: Shellharbour City Council Tip council best tip councils top 10 tips But this one should not match: ... City Council at Shellharbour. There is not any good tip at all. I need help to build an elasticsearch query for that. I was thinking about Regex query but I'm not quite sure about better alternatives. Thanks You can use a combination of the span_near query, span_multi and span_or . We

php : word proximity script?

妖精的绣舞 提交于 2019-12-04 06:08:43
问题 Okay - so, I've spent ages searching in Google, and even went through a few specific searches at hotscripts etc., several php forums and this place ... nothing (not of use anyway). i want to be able to take a block of text (page/file/doc) and pull it apart to find the "distance" between specific terms (find the proximity/raltional distance etc.). I woudl have thought there'd be at least a few such thigns around - but I'm not finding them. So - it may be harder than I thought. I understand it

Help with PROXIMITY_SCREEN_OFF_WAKE_LOCK in Android

℡╲_俬逩灬. 提交于 2019-12-04 05:16:23
I've enabled the proximity wakelock in my app, and it turns off the screen when the proximity sensor detects something. But there is a problem when the screen wakes back up -- it goes to the lockscreen, not my app. This happens regardless of the time that the screen was off (even if the sensor is cleared after a few seconds). Here's the code I used: int PROXIMITY_SCREEN_OFF_WAKE_LOCK = 32; mProximityWakeLock = pm.newWakeLock(PROXIMITY_SCREEN_OFF_WAKE_LOCK, LOG_TAG); if(!mProximityWakeLock.isHeld()){ mProximityWakeLock.acquire(); } Is there any way to correct that behavior? You can dismiss the

Proximity alert for locations saved at server

只谈情不闲聊 提交于 2019-12-04 00:56:55
I did some search but could not find a suitable answer. My App should compare with multiple locations for proximity. This means I will not be able to save all the locations into my app to confirm the proximity using locationManager. I want the proximity confirmation to be done in the server What would be the best way to implement this? Would it be sensible if the app asks for proximity confirmation every time the devices moves around? I would try a different approach, since location updates from GPS are made once per second, and I don't think it's a good idea to ask the server each second for

Background service to control proximity sensor

拥有回忆 提交于 2019-12-03 22:40:59
问题 I need to run a service (always in background, I want the service constantly checking even if the application is closed) that control the proximity sensor status, and when it's covered launch an activity. I tried but I had error. Any examples of something like this? P.S. In my AndroidManifest I added: <service android:name="xxx.xxxxx.xxxxx.MyService" android:enabled="true" /> Here my MyService.java: (Eclipse don't report any error but when I try it on my device, apps give a force close.)

Solr proximity ordered vs unordered

纵饮孤独 提交于 2019-12-03 16:41:12
In Solr you can perform an ordered proximity search using syntax "word1 word2"~10 By ordered, I mean word1 will always come before word2 in the document. I would like to know if there is an easy way to perform an unordered proximity search, ie. word1 and word2 occur within 10 words of each other and it doesn't matter which comes first. One way to do this would be: "word1 word2"~10 OR "word2 word1"~10 The above will work but I'm looking for something simpler, if possible. Slop means how many word transpositions can occur. So "a b" is going to be different than "b a" because a different number

Keep display on when the proximity sensor is covered

夙愿已清 提交于 2019-12-03 16:32:21
问题 I want to intercept the proximity sensor without turning off the display. I know by the documentation that I have two Bool variables: proximityMonitoringEnabled proximityState and this code [UIDevice currentDevice].proximityMonitoringEnabled = YES; When the proximity sensor detects something it turns off the display, same way it does when you're holding the phone to your ear when on a phone call. How do I keep the display on when the proximity sensor is covered? 回答1: After reading different