Best way/workflow/logic to detect when a vehicle is stationary - azure

I am currently uploading the gps positions of some vehicles to the azure tables. I was wondering what the best logic was and what component (if any) can help me determine when a vehicle is stationary.
I have seen that with Azure Maps I can deduce if the vehicle is within a specific area. Can I introduce other logics? o Can I use other tools in the Azure universe?

this is not related / restricted to Azure services, but rather it's pure logic. I guess you just need to compare geolocations given some interval.
Calculate distance between 2 GPS coordinates

Related

Foursquare API: how to explore venues within an administrative division such as ‘borough’

I am a beginner user of Foursquare API.
Most of the Foursquare techniques I learned so far is to do query such as search for or explore from a single location point (e.g. a café or a hotel) in a single geographical coordinate pair of longitude and latitude.
My question is, if it is possible to make an query to explore venues within an area, instead of in the vicinity of a single location point. By ‘an area’, I specifically mean the unit of the administrative division, such as a borough, of a neighbourhood.
In other words, my intending query, if possible, would start from an area specification of the administrative division of my interest (e.g. borough), such as its name or its border’s geographic coordinates—as a 'key' to link with Foursquare data, rather than start from a single location point.
I downloaded GeoJson file that already defined the geographical coordinates of the border of the administrative division of neighbourhoods in a city that I am interested in (link: http://cdn.buenosaires.gob.ar/datosabiertos/datasets/barrios/barrios.geojson). Just FYI, in this link, the neighbourhood is described as ‘barrio’ and the border is defined in the form of 'Polygon'.
I just wonder if I can use an area specification—either the name of an administrative division or a set of the geographic coordinates of an administrative division's border—as a key to make an query about venues such as restaurants, hospitals, and polices within the unit of an administrative division (e.g. borough) from corner to corner.
I guess that the underlying question is if Foursquare side has such info stored in somewhere in its system: if not, my contemplated approach would not work.
Or there might be a totally different workaround to achieve my goal.
If anyone can advise me on this matter, I would highly appreciate it.
Thanks
Given the parameters listed in the docs I think that the best approach would be to use the ll or near parameters and also include a radius so you can limit the search for a given area or region.
To get the middle point for the polygon I guess you would need to do some math but shouldn't be that difficult.
Besides this I think there doesn't seem to be any other parameter in Foursquare API to search by area or by a coordinates array (polygon).
Anyways, I would suggest that you go through the Foursquare API docs for both search and explore endpoints and check for yourself.
since you already have the polygon of interested region:
you could fit many small radius circles within to cover majority of the area.
this is not recommended as it may be rate limited or get you blacklisted but: the foursquare website has a 'draw' tool that allows you to draw a polygon and search venues within. (open networks tab under inspect in your browser and see request) I have noticed that it also can't take very complex polygons, no enclaves, and it further aggressively simplifies polygons to remove holes/dents/land bridges.
here's my demo requests. polygon search isn't strict and might show some venues outside the border.
the url:
https://foursquare.com/explore?mode=url&polygon=35.957999786220704%2C-80.41236877441406%3B35.897393965545646%2C-80.38215637207031%3B35.87847989454576%2C-80.55107116699219%3B35.954664894270834%2C-80.54901123046875%3B35.994118756097%2C-80.386962890625%3B35.957999786220704%2C-80.41236877441406
the corresponding get for venues:
https://api.foursquare.com/v2/search/recommendations?locale=en&explicit-lang=false&v=20210302&m=foursquare&limit=30&intent=bestnearby&polygon=40.8252411857252%2C-74.00630950927733%3B40.817446884558805%2C-73.99772644042969%3B40.81147063339219%2C-73.99875640869139%3B40.80757278825516%2C-74.00768280029297%3B40.80887209540822%2C-74.01729583740234%3B40.81406906961218%2C-74.02175903320312%3B40.8197852710803%2C-74.02210235595702%3B40.826280356677124%2C-74.01695251464844%3B40.8252411857252%2C-74.00630950927733&wsid={}&oauth_token={}

Finding all geohashes within two bounding coordinates

I have coordinates, which are assigned a corresponding geohash in my database. Now I want to retrieve all of the coordinates within two bounding coordinates (top right and top left corner). How can I do that properly?
I tried getting the geohash that fits both of those bounding coordinates, but this solution does not work when they are in completely different regions of the world (so they are not sharing anything in common).
Is there a better way to do that?
Thanks for your help
Unfortunately, this isn't something you can do out-of-the-box with datastore / App engine. (There are no built in spatial queries.)
For early prototyping, etc., you can do it the hard way - retrieve all the rows, and discard the ones not meeting your query in code. Obviously, probably not viable with real production data.
See related question Query for Entities Nearby with Geopt for some possible production solutions.

Azure Search Distance filter with variable distance

Suppose I have the following scenario:
A search UI to allow individuals to find plumbers who are able to service their home location.
When a plumber enters their info into the system, they provide their coordinates and a maximum distance they are willing to travel.
The individual can then enter their home coordinates and should be presented with a list of plumbers who are eligible.
Looking at the Azure Search geo.distance function, I cannot see how to do this. Scenarios where the searcher provides a distance are well covered but not where the distance is different for each search record.
The documentation provides the following example:
$filter=geo.distance(location, geography'POINT(-122.131577 47.678581)') le 10
This works correctly but if I try and change the 10 to the maxDistance field, it fails with
Comparison must be between a field, range variable or function call
and a literal value
My requirement seems fairly basic but am now wondering if this is currently possible with Azure Search?
I found an azure feedback suggestion asking for this feature but no news on if/when it will be implemented. Therefore it is safe to assume that this scenario is not currently supported.
To add to Paul's answer, one possible workaround is to use a conservatively large constant value instead of referencing the maxDistance field in your $filter expression. Then, you can filter the resulting list of plumbers on the client to take each plumber's max distance into account and produce final list of plumbers.

Obtaining GPS coordinates from Openstreet map and integrate them in an application

I have to create a battery analytics application for the car but I don't have real data avilable so I have created an online data generator. This generator (writen in node.js) generates different data for the car battery,speed, position etc. Regarding the position,I want to obtain GPS coordinates (from Openstreetmap) for different paths and integrate them in my generator.Can you suggest me any solution how this can be done?

Azure ML Recommendations

I want to use Azure ML to find related products using information from receipts from a store.
I got a file of reciepts:
44366,136778
79619,88975
78861,78864
53395,78129,78786,79295,79353,79406,79408,79417,85829,136712
32340,33973
31897,32905
32476,32697,33202,33344,33879,34237,34422,48175,55486,55490,55498
17800
32476,32697,33202,33344,33879,34237,34422,48175,55490,55497,55498,55503
47098
136974
85832
Each row represent one receipt and each number is a product id.
Given a product id I want to get a list of similar products, i.e. products that was bought together by other customers.
Can anyone point me in the right direction of how do to this?
This seems a good fit for their frequently bought together service (https://datamarket.azure.com/dataset/amla/mba). You may have to preprocess the dataset to get it in the required format. This service has a web UI as well: https://marketbasket.cloudapp.net/
This is a typical problem for Recommender, you can use a model called Machbox recommender to cover such a problem.
Recommender typically use Scoring about items to propose and the use some tricky calculation to predict scores for items users had not scored yet ( a score would be typically 1 user bought the item, 0 he did not)
If you need more details let me know ..(you have access to a free version of Azure ML where you can try all this)
Regards

Resources