A few questions about using FourSquare API for a food truck - foursquare

I am currently working on tying in social media for a Food Truck client. I would like to be able to show food truck locations on a map and also be able to indicate the current location of the truck on the map. I have a few questions regarding this since I have never used FourSquare before.
Can I create one "moving target" business and have them check in with that, or do I need to have them make a separate location for every location the food truck will be?
Is there a way to distinguish a current location from past locations(i.e. can I include a parameter in the search query to display a different icon for a location if the food truck checked in within the past 30min-hour or something similar?)

Related

Creating region-based data and use the data if a point (GPS-coordinate) falls under a region

I was trying to implement a feature where if a user books a particular location for service, the pricing should be based on the data that is already configured for that region. The region could be an establishment, street, city, town or even a country.
I have tried to make use of Google-place-details API to create the region-based data with Place Types information.
Eg: For creating a region-based data pricing for Washington State, will receive place type information such as administrative_area_level_1, country etc.
And if a person chooses a place inside the Washinton state, from the Google-place-details API, Place Type information can be received which can be used to match if the particular location falls into that region.
I'm unsure since its completely depending upon google APIs and any expendability issues later.
Are there any other generic ways to look into or
should I implement this feature with bounding box co-ordinates to determine the region. Please share your thoughts on this.

How do I store locations in neo4j to make geography based search better

I have nodes like
(p: Program)-[:DEPLOYED_AT]->(l : Location)
A program can be deployed at any location. The information which I am storing in Location node is that which I am getting from Google place autocomplete api. I have to search for programs using location. And user can search any location it can either be country, state, city or even locality. I want to know what and how the place info should be stored in location node to make search better. Search would be like, if I am searching for "India" then it should show me all the programs deployed in "India", if I am searching for a state like "Karnataka" then it should show me only those programs which are deployed in "Karnataka" and same for city and locality. Firstly I thought I would store country, state city, lat, long in my Location node and when user search for a particular location say "Bengaluru" then I will fetch city, state and country from the searched location and give the result. But sometimes its very difficult to fetch city, state , country from searched location specially in case of locality. I also don't want to restrict this search only for India so I have to store the location in such a way that it should support all the location search . Storing city, state, country will fail in many cases. I am curious to know how do sites like airbnb, housing store the location based information. All comments and suggestions are welcome.
Thanks in advance

Solr Merge results

I use Solr for product filtering on our website,
for example you can have a product filter where you can filter database of Televisions by size, price, company etc.,. I found Solr+FilterQuery to be very efficeint for such functionality. I have a separate core that has the product info of all TVs in our DB.
I have another Core for product reviews. The review can be on a specific product type or company. So someone can write a review on a Samsung TV or Samsung customer service. So when someone searches for a text (for example "Samsung TV review" or "Samsung customer service"), I search this core.
Now I want to merge the results from the above cores. So when someone searches for 'samsung 46 lcd contrast ratio review', I esentially want to filter the TVs by Company (Samsung), then by size (46") and then find reviews that have text "contrast ratio review". I have no clue how to do this. Basically I want to merge the results by document ID and add additional colums for result 2 into result 1.
I have seen suggestions to flatten out the data but I want to use reviews index on a lot of other filters. So I am not sure if thats a good idea. Moreover if new reviews start coming in I dont want to reindex all the cores of products (even delta reindexing will touch lot of products).
Any ideas on how to acheieve this?
If I got your question right what you are looking for is JOIN functionality.
http://www.slideshare.net/lucenerevolution/grouping-and-joining-in-lucenesolr
http://wiki.apache.org/solr/Join

Foursquare API: Search venues in whole city

Is it possible to search venues (via venues/search) in whole city without passing "radius" parameter? Because I don't know radius of each city :) Documentation says "Searches can be done near a point or through a whole city", but how can I provide this in venues/search?
Thanks.
I do not think there is a way to tell it 'search the entire city', but I also think it might be a wrong use case.
You need to remember a few things when searching:
Foursquare will return up to 50 results (the limit parameter)
The 50 results are ordered by the most popular places around the center of your search
So if you are searching a city which have more than 50 venues in Foursquare database, 'searching the entire city' will usually get the same (up to) 50 results - always.
This where the filters comes in handy, in our case, to get you better results for our needs, we use the categoryId combined with the radius to get things we want to show our users. Sometimes we get information from other cities because of a big radius, but for our application its okay, we actually give our customers more options :) . I can also guess that a lot of apps also use the query filter as they know the name of the place they are looking for.
You just need to experiment with it and discover how to get the data which is right to your application.
In theory, to search an entire city I would use the city lat/lng from Google or Open Street Maps or geonames and do a 10Km search around that point (intent=browse, radius=10000), the following is a guess, but it will get 50 places for over 99% of the cities people who own smartphones live in :)
You can do obtain results within in a city as follows:
https://api.foursquare.com/v2/venues/search?near=Singapore,Singapore&client_id=YOUR_CLIENT_ID
&client_secret=YOUR_CLIENT_SECRET3&v=YYYYMMDD
For more details check the documentation:
https://developer.foursquare.com/docs/venues/explore
Assuming you're talking about requests with a query, I would just set a reasonable value for radius and use the city's default city center. If you want to avoid showing results from neighboring cities, you can post-request filter by the returned venue's "city" string in the location stanza.

Magento geographical search and product recommendation

I'm evaluating Magento for a travel company who will need to do product searches and recommendations based on geographical distance. The company is creating custom holiday packages based on various components (eg: accommodation, tours, restaurant vouchers, etc). These components potentially have overlapping locations (ie: a particular tour might be close enough to several hotels to be considered related to each of them).
As a user builds up their custom package by adding stays at various hotels, I'd like related product recommendations to appear based on geographical location. And, if they search for tours, I'd like closer tours to be weighted toward the top of the catalogue search results.
Nice to have: the ability for the user to select how close / far they consider "close enough" to be (eg: 10km, 50km, 200km, etc).
My research indicates there isn't out of the box support for any sort of spatial queries in Magento. The best solution I could come up with was custom product attributes which list "location" where each product is manually assigned to various locations. But I think that's going to get pretty hard to manage for more than ~50 locations. Is my research correct? Is there an add-on / extension which will fulfil this scenario? Do you think overlapping 50 locations will be manageable in the backend?
Coming from a Microsoft background, my natural inclination would be to enable SQL Server 2008+ spacial functionality and do the queries in the database. Obviously, this option isn't available in the LAMP stack. Am I wrong? Does MySQL support spatial queries like WHERE productA.Location.GetDistanceFrom(productB.Location) < 50km?
Mysql supports spatial queries as well http://dev.mysql.com/doc/refman/4.1/en/spatial-extensions.html but nothing will help you or free you from entering the relations between products and it's location and you have to implement it yourself as well as extend the search based on location

Resources