how to get cross streets using foursquare - foursquare

How do I access the "between X and Y streets" using the Foursquare API?
Is there a way to query the foursquare API such as when Input=lat/long ; Output = "On A Street between B and C streets" like in the screenshot?
Thanks!

Any API that returns a venue object will give you the crossStreet. Check out the venues response here.
From the response docs the location object contains:
An object containing none, some, or all of address (street address),
crossStreet, city, state, postalCode, country, lat, lng, and
distance. All fields are strings, except for lat, lng, and distance.
Distance is measured in meters.
Some venues have their locations intentionally hidden for privacy
reasons (such as private residences). If this is the case, the
parameter isFuzzed will be set to true, and the lat/lng parameters
will have reduced precision.
Depending on what your trying to do you can get venue details, search or explore and see the cross street with each.

Related

Is it possible to use geodata (latitude & longitude) as a predictor variable?

I'm a newbie in programming and using machine learning. This is my first post here as I've just recently stumbled upon the first unresolved -of probably many- question.
So I have an extensive database with data on the real-state market of my country and I want to predict the price of the houses -a pretty standard theme ikr- using the latitude and longitude as one variable.
So far I have found Waddell & Besharati-Zadeh's study: https://arxiv.org/pdf/2011.14924.pdf in which they reconstruct the geodata by combining it with other libraries and obtaining string variables as to if certain activities are within a walking distance of 500 meters. So this is a cool alternative but I'm worried there's no accurate data of the walking distance and establishments to do certain activities in my country, not even on google maps. Is there any way in which the combination of the latitude and longitude alone can be used as a predictor variable?

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

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 )

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

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