In ABAP, we need to fetch detailed route from HERE API https://router.hereapi.com/v8/routes?transportMode=car&origin=21.11336,39.21516&destination=21.52779,39.25381&return=polyline&app_id={APPID}&apiKey={APIKEY}.
This API returns polyline which we need to decode to get GeoCordinates. We tried to decode using the algorithm given at https://github.com/heremaps/flexible-polyline, but it does not provide correct coordinates.
Can I get exact algorithm that HERE is using to encode polyline, so that to decode polyline in ABAP?
I know this is a bit old but found this answer on HERE help pages. An example of an encoded polyline is:
BGo9llkDg_rzZkF0G8LoQ4NoQgP8QoLgKgyB0tB4XoVoLsJ0K4IwWoQsOsJ8LwHoLoGkS0KkN8GsJ0F8GgF4D4DsE0FwHoLUgK8BkIkDkI7B0eTgUT0KjDkhBvCoa7BsT3DwgBvCoVnGg8BjNg4D3D8zB_EsxBjDwgBzFs2BrEgyBvC8V7G8uB7G4wBnBwMkI8BoBnLgP_hEgKz1CsE_nBsJrjD4E1tB
I found the following on developer.here.com page:
"This polyline is encoded using a flexible polyline. You can encode this polyline easily in many major languages using examples available in the flexible polyline repository."
GitHub repo: https://github.com/heremaps/flexible-polyline
"HERE Maps API for Javascript provides wrappers which can do the decoding for you."
I am not using HERE on the client side (even thought it is awesome), I am using some legacy mapping plugin.
I was able to use this code in this file to figure out how to decode the polyline.
https://github.com/heremaps/flexible-polyline/blob/master/javascript/index.js
My code takes the encoded polyline, sends it through the decode method and I end up with a cute object that contains the polyline array as expected.
Below is a screenshot of the console.log of the decoded object pasted above.
Related
I am working with Google Earth Engine plugin in QGIS and trying to get a point geomtry from QGIS to use in the python API code.
I wrote some code that needs point coordinates to start the process. I can do that by generating the point inside the script (point = ee.Geometry.Point([Xcoord, Ycoord])), but I actually need to generate that point interctively, that means I click on the map and point coordinates are passed to the code.
Only string I could find that seems related to what I'm seeking is map.onclick(callback), but I'm not sure that's what I need and anyway that throws the error AttributeError: type object 'map' has no attribute 'onclick'.
Does anyone have any suggestion about that?
Many thanks
I want to use the google translate API to detect a language being typed and also get the translation but it seems this is not possible according to the docs here.
Does anyone know if this is possible? Or would I have to make two calls?
Thanks
Definitely you can detect and translate your contents at the same time. To be more specific, it will detect the source language automatically without specifying the source language by simply calling the Translation API method translate().
You can directly call the translate method without specifying the source language and only specify target language. Below is code snippet of code using
google-cloud-translate jar. It works perfect
Translate translate = getTranslationServiceClient();
// Translates some text into target language
Translation translation = translate.translate("Hello", TranslateOption.targetLanguage("hi"));
I am using Google Charts API to generate QR code as referred in this link https://www.gregorystrike.com/2011/01/26/how-to-use-google-charts-api-to-generate-your-own-qr-code/
In this as the parameters are visible it seems to be insecure
Users can change the values available in the parameters using developer tools like inspector element of Firefox. Is there a secure way to generate QR codes
Thanks
QR codes are insecure anyway, anyone can see the data you place in it, by using any reader.
If want to use QR Codes in any sort of secure sense or to store sensitive data you will have to manage encryption and decryption of that data yourself, there a few encrypted examples but its not a heavily used function. Now we are past the Fab stage of QR Codes, they mainly used like barcodes for identification, with the ability to store more information if needed and the odd URL embedded link.
Although the limit is quite large this is still a limit to the amount of data you can place in a QR Code.
Lots of information on the Wikipedia page https://en.wikipedia.org/wiki/QR_code
I am trying to make an application which draws a heatmap. I have a file with home addresses which I am going to put on the map. Every address is a new line in this file.
I know how to create a heatmap layer when have coordinates.
What is the best way to get coordinates for these addresses?
I know there are couple ways of doing that, but the one that I am looking for is the way to do it on a server. I know that I have to send a request to the server. Can you please provide an example code in Java which gets a lat long coordinates for it.
You could use this library:
http://code.google.com/p/geocoder-java/
It has documented examples as well.
I have some rutes in KML format and I can't modify them. I want to draw them on a map but I also want to get the fist and last points to check for near cities and interesting places.
The problem that Google Maps API does server-side procesing and I cannot access individual elements form it. I searched and tried to use a parser like GeoXML but it's not exactly what I want because it uses its own map style an so on and I have to use Google API maps. I only do need to acces certain elements of KML tree and i will draw them using Google Maps API.
Can anyone help please? Thanks in advance for answer in these vacation days(for some).
You can use the standard KmlLayer in Google Maps for rendering, and then use a 3rd party library like GeoXML (or your own code to read the XML) to grab whatever data you need from the KML and run additional functions based on that.