Import Data From Google API to Parse - json

I am trying to import all restaurant data (within a certain location) from Google Places API to a Parse class. What is the best approach?
The types of data I need are: name, opening_hours (array), price, geometry (location), etc.
Do I need to download all the Google Places data first and then import it into Parse or can this be done all at once?
Parse supports "REST" API, should I be using REST or import through json/csv?
How do I go about "retrieving" the Google data? (trying to wrap my head around the concept)
Google API -https://developers.google.com/places/documentation/details
Parse Import API -https://www.parse.com/docs/data#data-import
Parse REST API -https://parse.com/docs/rest
Sorry for the newbie questions. I've never migrated data using API before.

I would advise against storing the data in a Parse class. The Google Places API is there for the ever-changing data that is out there on restaurants. If you import it into Parse, you would have to constantly update it. The Google Places API is fantastic and easy to use. Currently I use it in my AngularJS application for an autocomplete text input. I also use the Google Geocoding API in my Cloud Code with a Parse.Cloud.HttpRequest. Both work great but I would never want to import the API data and make it static...
I think a better option is like #jsetting32 commented about. Query the API for the events in the area, then save the one the user selects in a ParseObject. You can pick and choose the data you want to save and even give it start and end dates so users can look at past events.

Related

Listing model files in BIM360 through data management API

I have a need to display models stored in BIM360 in the Forge Viewer. For this reason I'd like to list all models that are contained in a project.
I was looking at fetching them using the search API. Is this a reasonable way to do it? I guess the only way to identify model files is to use attributes.fileType in the filter? And then look at the relationships.derivatives data. Or is there some other way to search for models?
Unfortunately, your request is not supported by the Search API currently. With my experience, extracting relationships.derivatives out is the only way manually from the API responses that contain this attribute e.g.
GET projects/:project_id/folders/:folder_id/contents
GET projects/:project_id/items/:item_id/tip
GET projects/:project_id/items/:item_id/versions

Extracting quarry sites geographic data from OSM or Google Maps API

Does anyone know where or how I can get geographic data for quarry sites for Australian states or local governments? I have searched all over the data repositories hosted by the levels of government.
Now I resorted to extract this data from Openstreetmaps or Google maps API, but I can figure out how to achieve this after trying to check around. All the pointers doesn't seem to yield any data.
How can I get data and specifically quarry sites from OSM or Google Maps API?
Quarries are tagged in OSM as landuse=quarry. For retrieving specific data you can use Overpass API. Overpass API has a nice frontend called overpass turbo.
Here is an example query for retrieving all quarries in Australia:
[out:json][timeout:90];
// fetch area “Australia” to search in
{{geocodeArea:Australia}}->.searchArea;
// gather results
(
// query part for: “landuse=quarry”
node["landuse"="quarry"](area.searchArea);
way["landuse"="quarry"](area.searchArea);
relation["landuse"="quarry"](area.searchArea);
);
// print results
out body;
>;
out skel qt;
You can view the result here. There are also options for downloading raw data.
Constructing the query is as simple as opening overpass turbo, opening the wizard and typing "landuse=quarry" in Australia. Afterwards the timeout parameter has to be raised manually since the default timeout of 25 (seconds) is too low for querying such a huge country.
Note that the query language of Overpass API is quite powerful and there are many ways to enhance your query. Also note that it is possible to call Overpass API directly without the need of overpass turbo which is just a nice frontend.

When using the Google Places API, what is the difference between "using the JavaScript library" and "calling the API directly"?

I have seen the two forms of reference to the Google Places Library/Service, using JavaScript vs calling the API directly, a number of times, but I don't understand the difference. The Google Docs don't describe anything about two methods of accessing the API.
For example, this question talks about 2 ways of accessing the API: OVER_QUERY_LIMIT in a loop
And it appears that there is some type of direct web access taking place in this question: Querying Google Places API using jQuery
Is this something where there was an old way that involved formatting URL parameters and the new way is by utilizing the JavaScript library calls?
FINAL SUMMARY EDIT: There are two distinct ways of requesting data from Google, as described in #Dan Nissenbaum's answer below. And since my original question, the QUERY_LIMIT question referenced above has been edited to also include more information about the two options.
Perhaps you are referring to the distinction between the Google Places API that is intended for use on the SERVER (i.e., utilizing PHP to call the Google Places API directly), and using the completely different approach of the Google Places Javascript Library in which the BROWSER executes Javascript using the Javascript library provided by Google (that internally wraps calls to the Google Places API, so that you, as a Javascript programmer, only need to understand the Javascript library provided by Google, and use that)?
Here are the two scenarios.
Scenario #1: Use the API directly. For this method, you must refer to Google's API documentation for the Google Places API: https://developers.google.com/maps/documentation/places/.
Using this API works as follows (giving a simple example only). Say you want to retrieve places within 1000 meters of latitude=-27.2531166, longitude=138.8655664. You need to hit a URL as described by the API documentation: https://developers.google.com/maps/documentation/places/#PlaceSearchRequests.
In this example, the URL looks like this (it's long):
https://maps.googleapis.com/maps/api/place/search/json?location=-27.2531166,138.8655664&radius=1000&sensor=false&key=AddYourOwnKeyHere
You need a key for your personal use, which I assume you have. There are other options you can specify, such as limiting the results to restaurants, etc.
When you hit this URL, the data will be returned in either JSON, or XML format, as specified by the text json in the URL above (use the text xml for xml). This data is returned exactly like data is returned from any URL call when you hit a URL in your browser.
You can test this by simply typing the URL directly in your browser, and see the results.
To use the API directly from code, you will need to use code that hits the external URL above within code and retrieves the results within code (for example, using the PHP CURL library, or using AJAX in Javascript).
Scenario #2: You use the Javascript library that Google provides that wraps the API, so you don't need to deal with it. I'll update the answer with more details about this, if you don't know what this is.
The docs do discuss the two different approaches. The Places Library utilizes the Google Places services from within the JavaScript Google Maps API. If you are using the Google Maps API in a browser, this is probably the approach for you:
https://developers.google.com/maps/documentation/javascript/places
There is also a web service, which allows you to query directly from your application. You query it using direct http calls to Google services. If you need access to the data on your server or a mobile device, this is the approach you want to take:
https://developers.google.com/maps/documentation/places

How to retrieve My Places maps data from Google Maps?

Is it still possible using JavaScript to get My Places data out of Maps? With the move to Fusion Tables and deprecation of the Maps Data API, I can't seem to find information on how to get this data...if it's even available in FT.
The Maps Data API was the only programmatic endpoint to accessing this dataset. However you can still export the data by selecting a map, and then clicking the KML link.
A variety of tools are available for visualizing, importing, and converting KML data in case you want to import it elsewhere.

Using C++ with Google Maps API. Only text info required

Is it possible to call Google Maps API using a C++ code to retrieve text info about nearby locations.
I am trying to make a simple application (C++) which gives the information about Nearby places on entering longitude and latitude info. Only data I am looking for is the Name of Nearby place and its distance from mentioned location.
Is it possible?
I think your best option would be to use the Google Places API with the JSON format for request.
I don't know about any library that would perform the thing automatically, but there is a thread on StackOverflow about JSON parsing in C++ . Even it does not provide an answer it as good votes scores.
I guess the web call could be made with something like curl.