Foursquare API's - venue searching method - Priority limit vs radius - search

Hi every body,
I have a concept problem. I would like to know how FourSquare looks for venues? (how it segments the search area? are they circles with gradually increasing radius? or a randomly choosing from the asked radius )
.
example:
Limit = 100
radius= 1000
total number of venue exist in this radius = 5000
.
which of these two option is the case? :
1- the result will be the 100 venues in a small circle ( like 100 venue in radius of 150 )
2- the result will be the 100 venues and they are well distributed venues come from a radius of 1000
.
To have an idea about why I'm asking this question, my main problem which I try to solve is:
find a radius of fixed number of venue in different adresses. my objective is to find a density index.
for example in in the center of Toronto we have 100 venues in a 50 meters radius, for the same number of venues, in a smaller city, we reach perhaps a radius of 200 meters.
.
Thanks

I solve my problem by some estimations but it is good to share the experience:
When we have to request one for radius 100 meter and other for 200 meter, logically we expect that the number of second one be greater than first, which, IS NOT the case with foursquare.
Some of venue in 100 radiuses won’t be in 200 radiuses.
So, I did request for 100, 200, 300… 1000. Then joined them all, then removed duplicated. So I have some estimation. But it is not the complete venues ( I checked on google map )

Related

Calculating "Reliability" of Cricket Stats

I'm not a statistician so please forgive the (mis)use of terminology.
I am calculating strike rates for batsmen in cricket. For non-cricket fans, this is the number of runs scored (broadly the same as points in other sports) per 100 balls faced.
So if a batsman has faced 100 balls in his career and scored 150 runs his striker rate would be 150 (runs/balls*100).
I now want to calculate how likely it is that the stat is an accurate representation of the batsman's ability.
The more balls batsmen have faced the more likely it is that the resulting stat is accurate but how do I calculate how reliable it is?
Any help would be appreciated.
Thanks
You have a point estimate, and a confidence interval can help you quantify your uncertainty. For your example of 150 runs in 100 balls, is there a certain number of balls per run? If so, you can definitely create a confidence interval using the standard formula and choose your level of confidence.
E.g. X bar +/- t_{99, 1-alpha/2} s/sqrt(n) is a 1-alpha/2 level confidence interval for the average hits per ball
Multiplying by 100 gives a CI for the average hits per 100 balls
Unfortunately, if you have no other information than the aggregate 150 runs in 100 balls, there is not much you can do

Google Places API doesn't restrict results to given radius parameter

I'm using this code in NodeJS to retrieve the results:
return googleMaps.places({
language: 'en',
query: keywords,
location: [loc.lat, loc.lng],
radius: 5000
})
As you can see, there's a restriction for 5000 meters max. For some reason I got results from another city which is about 50KM away from that lat, lng (some of the results were in the relevant distance, half were not..)
Any thoughts?
It looks like you're using Google's Place Text Search service. The documentation states:
radius — Defines the distance (in meters) within which to bias place
results. The maximum allowed radius is 50 000 meters. Results inside
of this region will be ranked higher than results outside of the
search circle; however, prominent results from outside of the search
radius may be included.
You may bias results to a specified circle by passing a location and a
radius parameter. This will instruct the Google Places service to
prefer showing results within that circle. Results outside the defined
area may still be displayed. Biasing results to a region or circle is
recommended to improve relevance of results for otherwise ambiguous
queries.
So this appears to be expected behavior from the API. There is no way to fully restrict Text Search results within a given location/radius.
Hope this helps!

How to create geospatial module with AWS lambda and dynamo db

First let me thank you for taking the time in reading my question.
My plan was to add latitude and longitude records on my persons records in dynamodb and then use a geo library, preferably written in nodejs, for calculating nearby persons in a given radius. So the plan was, for example, return the persons only from this 50 mile radius.
So far, the only geo-libraries i have tried allows me to pass lat and long to it and confirm if it is within the radius given. The problem with this is that I have to loop my whole dynamodb table to get results. Is there a reverse kind of function for this in which I pass a latlong point and radius to the geo library and then the geo library passes me some lat and long boundaries so that I can easily query it to dynamodb(ex. (lat<:latboundary1 AND lat>:latboundary 2) AND (long<:longboundary1 AND long>:longboundary 2) )
This nodejs library provides a function that calculates the bounding box based on a point and a radius. You can use the returned SW and NE points for your query.
.boundingCoordinates(distance, radius, inKilometers): Calculates the bounding coordinates of distance from the point and returns an array with the SW and NE points of the bounding box . If radius is not provided, the radius of the Earth will be used. The distance is calculated in miles unless inKilometers is true

Instagram Media/Search API

What is the smallest radius does Instagram Search Media API support ?
As I'm trying with radius of 50 meters, but not seems to be accurate.
Thanks.
I have noticed that some of the data returned from this API regardless of the radius are not accurate and not within the radius, there are some cases when 1 or 2 data points are way outside the radius, I manually filter out those, check out http://map.gramfeed.com

Increasing radius parameter of Foursquare API request omits nearby venues

I am using the Venues platform to search for venues under the category "Food" given a latitude and longitude.
Here's the request I started out with:
https://api.foursquare.com/v2/venues/search?ll=37.783207,-122.441673&limit=50&categoryId=4d4b7105d754a06374d81259&intent=checkin&radius=520&client_id=CLIENT_ID&client_secret=CLIENT_SECRET&v=20120721
This gives me the desired results, however, if I increase the radius from 520 to 5200, I get venues, but I lose venues that are nearby.
I think this is because I limit the results to 50 venues (max allowed by Foursquare) and there are more than 50 venues within a 5200 meter radius. In this case, it seems like Foursquare gives me back the 50 most popular places, which omits some venues. I'd like to have this larger radius, but make sure I get back the venues closest to me.
Are there other parameters that I need to include for this to happen? How can I make sure I get back the nearest venues within a large radius?
If you just want reasonable quality venues that are physically close to the user, don't specify a radius at all for intent=checkin -- the default is dynamic based on the density of venues nearby.
intent=browse will give you the top venues in an area without a proximity bias.

Resources