Google Geocoding API, HTTP, CSV-data in API v3 - google-maps-api-3

I'm developing embedded software for a gps-tracker. Until this time I used Google Maps v2 for reverse geocoding (to convert GPS-coordinates to address string). I used http-request and a short-response-form (csv) (http://maps.googleapis.com/maps/geo?q=&output=csv&...). Now, when the support of API v2 is almost over, I try to migrate to v3, but I can't find a csv response-format in http-request settings. The response-size is a critical parameter for the device. How do I solve this problem? Thank you.

According to the documentation you're stuck with JSON or XML.
A Geocoding API request must be of the following form:
http://maps.googleapis.com/maps/api/geocode/output?parameters
where output may be either of the following values:
json (recommended) indicates output in JavaScript Object Notation (JSON)
xml indicates output as XML
Example: the query should look like this:
http://maps.googleapis.com/maps/api/geocode/json?sensor=true&address=Your+address+here
or
http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=Your+address+here
where required parameter sensor indicates you are calling from a location sensor enabled device or not.

Related

Problem using ArduinoHTTPClient sending GET requests with ESP32

Board : ESP32 T-Call SIM800L
Code Functioning
Collect Data from phone -> Put Into URL -> Send to Server
CollectQualitativeData() -> AppendQueryParameters() -> http.get(resource)
My code allows me to enter 4 different strings in my android app which my ESP32 receives via bluetooth and stores as an array of char arrays QualArray[4][30] (eg. {"string1","string2"....) . It then adds these strings in the URL query parameters for which I send data to my google sheets web app with a GET request (I know i'm posting data but the get request is what is used for the google apps script when posting data).
Problem
The code works when I pre-define the URL to be sent, although the issue seems to be that adding the strings obtained from the android app to the URL returns an HTTP response of -3 and doesn't upload to the google sheets server. This confuses me as the strings are stored okay because I print them out and they are correct, and then adding them to the URL and printing the URL it looks correct (and identical to the pre-defined URL that works) but for some reason it doesn't work. I thought it could be memory related so I pre-defined all the char arrays with set buffers but still didn't work
Code
https://github.com/Conwon99/4th-Year-Project/blob/main/ESP32_HTTP_REQUEST
The functions to look at are CollectQualitativeData() which is called in setup and AppendQueryParameters() which is called in the loop, then http.get(resource) is called afterwards in the loop which makes the GET request.

Call a REST API from Kusto function

I have a logs endpoint rest url that I want to call and get the contents by calling a function. In a simplified way, create function like below.
create function getData(url:string)
{
let data = curl GET url;
print data
}
//Call it.
getData("<some rest url here>")
The documentation from Microsoft seems to talk about Kusto's own APIs not not how to call an external API. Am I missing something?
The documentation you reference relates to calling Kusto service REST APIs.
Kusto query language is a query language, not a open-ended programming platform.
Call-outs to external sources such as SQL Azure are possible, but subject to certain restrictions, primarily security-oriented by nature.
See external data operator, sql_request plugin, and callout policy articles.

How to get Timezone info, Timezone id in particular, in HERE API Batch geocoding process

I am moving from Google to Here-Api Geocoding service.I need to implement batch geocoding using HERE Batch Geocoder API. Till now I am able to get almost all of the needed info from Batch Geocoder API. However, I am not able to find a way to get TimeZone info in Batch Geocoder API response.
For example,I was able to get Timezone object through Here Forward Geocoding API- by set query parameters 'gen=9&&locationattributes=adminInfo,timeZone', but this two APIs-Geocoding and Batch Geocoder API seems to work slightly different.
I tried various combinations of query params using this generic URL:
http://batch.geocoder.cit.api.here.com/6.2/jobs?action=run&app_code=[your-app-code]&app_id=[your-app-id]&gen=8&header=true&indelim=|&outdelim=|&outcols=displayLatitude,displayLongitude,navigationLatitude,navigationLongitude,mapViewTopLeftLatitude,mapViewTopLeftLongitude,mapViewBottomRightLatitude,mapViewBottomRightLongitude,locationLabel,houseNumber,street,district,city,county,state,postalCode,country,relevance,matchLevel,matchType,matchCode,mapReferenceId,responseAdditionalData,addressAdditionalData&addressattributes=all&locationattributes=all&responseattributes=all&maxresults=5&outputcombined=true&mailto=[yourname#domain.com]
I took it from a response here:
How and what do responseattributes return for the Here Batch Geocoder API?
However, neither in posted URL nor in HERE Api documentation I found a way to include in "outcols" information for Timezone(i need only the TimeZone Id anyway).My logic is basically that if params gen=9 and locationattributes=adminInfo,timeZone are set it should work in Batch geocoding(as it works in Forward Geocoding API).
Looking at the documentation it seems to me that Timezone info is not included in batch geocoding response at all, which is a problem for me since I need Timezone Id and in this way after Batch geocoding I need to make request for each entry to set Timezone id.
In short, I need to take TimeZone info(TimeZone Id) from HERE Batch Geocoder API
The BatchGeocoder Service does not support time zones only the Geocoder Service does support this right now.

AWS PDF upload through http post

I am new to AWS and I am trying to upload a pdf document to S3 trough an AWS API. I am using an HTML form with a post method. The action of the form is the URL of the deployed API. The API is integrated with a lambda function. My question is how can I extract the uploaded file to proceed within the lambda function, to perform some processing before uploading to S3. Is it even possible?
I have tried the instructions found in this post:
Passing HTTP Post from AWS API GW to Lambda
However, I return the event from the lambda function and this is what I get:
{file: file.pdf , acl:private,
success_action_redirect: http://localhost/, AWSAccessKeyId:my_aws_key}
The file I uploaded is called file.pdf.
Any guidance will be appreciated.
A pdf file is a binary format. API Gateway does not currently support binary data. We know that binary data does not work and there are no workarounds to make it work reliably. A number of customers have requested that we add binary support to API Gateway and it is prioritized on our backlog.

REQUEST_DENIED when using Google Maps AutoComplete

I am unable to use Google Maps AutoComplete. I have read all the articles about this problem, and I still get REQUEST_DENIED:
The following services are turned ON:
Google Maps API v3
Places API
Prediction API
Simple API Access:
API key: **
Referers: Any referer allowed
Activated on: (A few days ago)
Activated by: ** – you
I have even activated my credit card (don't know if that makes a difference for traffic under the quota):
The following happens (tested both from a browser and command line cURL):
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=New&types=(cities)&key=$apikey
{
"predictions" : [],
"status" : "REQUEST_DENIED"
}
How do I make this work?
From the documentation
Required parameters
input — The text string on which to search. The Place service will return candidate matches based on this string and order results based on their perceived relevance.
sensor — Indicates whether or not the Place request came from a device using a location sensor (e.g. a GPS) to determine the location sent in this request. This value must be either true or false.
key — Your application's API key. This key identifies your application for purposes of quota management. Visit the APIs Console to select an API Project and obtain your key. Maps API for Business customers must use the API project created for them as part of their Places for Business purchase.
I don't see "sensor" in your example request.

Resources