here-api CalculateRoute using Address instead Geo - here-api

Is there a way call the CalculateRoute API for truck with a source and destination address, instead of source and destination geo.
So, basically, this API with addresses https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apiKey={apiKey}&mode=fastest;truck&waypoint0=geo!52.534924,13.199499&waypoint1=geo!52.532767,13.198141
Right now, we are doing it using Geo, but the response time is high because we would have to retrieve SourceGeo, DestinationGeo and then CalculateRoute.

There are three ways in which waypoints can be specified in calculate route API.
geo
street reference
linkID
https://developer.here.com/documentation/routing/dev_guide/topics/resource-param-type-waypoint.html
However you can pass address in reverse Geocoder API, get exact waypoints and use it in route API to calculate route,

Related

Analytics Measurement Protocol "Document location URL" parameter (dl) Question

I have a couple of questions about the "Document location URL" parameter (dl) of the Measurement Protocol (Universal Analytics) (see https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#dl):
If the &dp parameter is added to override the path + query portions of the document location, is there a way to retrieve the original complete URL path via an API call?
If the &dp parameter is used, would Google still store the original path and query string somewhere?
Thank you in advance for your help!
Clayton

Geocode Autocomplete example won't return result with my api key

I've generated the sample URL with my api key by clicking on the {YOUR_APIKEY} that inserts my API key into the example on HERE Geocoder Autocomplete API documentation page. I've then entered that in the URL bar of a Chrome browser. The result is a page that says:
This site can’t be reached, autocomplete.geocoder.ls.hereapi.com refused to connect.
Search Google for autocomplete geocoder here api suggest
ERR_CONNECTION_REFUSED
Can I not just test this to see what the result is? I need to be able to submit a URL and read the JSON result for a list of addresses. These are ill-formatted addresses, so I'm looking for the autocomplete to try to find the correct address.
It looks like Geocoder Autocomplete API doesn't redirect http requests to https, so just update your requests to use https:
https://autocomplete.geocoder.ls.hereapi.com/6.2/suggest.json?apikey=<YOUR_APIKEY>&query=Pariser+1+Berl
Here is a sample code in js and also js+html code that might help you >https://developer.here.com/documentation/examples/rest/geocoding_suggestions
Create a Dom element which could take an input or enter it manually!

Retrieve roadnames separated by each state HEREapi

Is it possible to use calculateroute in HERE api to retrieve roadnames/roadnumbers parsed by each state the route travels through?
Routing API request gives the maneuverattributes(roadname, roadnumber) from origin to destination.
Please refer following link for detailed explanation as per your use case
developer.here.com/documentation/routing/topics/resource-calculate-route.html

Determine timezone based on location using Here APIs

I want to get get the timezone of a location (lat/long) using the here REST APIs. I know there is a Google timezone API to do this, but I couldn't see any timezone information in any "Reverse Geocoding" API responses for the here REST APIs.
For reverse geocoding you need to add additional parameter locationattributes=tz to the request. Example request:
https://reverse.geocoder.cit.api.here.com/6.2/reversegeocode.json
?prox=50.112,8.683,100
&mode=retrieveAddresses
&app_id=xxx
&app_code=yyy
&gen=9
&locationattributes=tz
You can find a full description of available input parameters by link: https://developer.here.com/rest-apis/documentation/geocoder/topics/resource-reverse-geocode.html

How to get URI from which REST API (ServiceStack) being consumed

I have some issue regarding REST API which i have built using servicestack. End user will consume this API from their application hosted on their server. I'd like to grab absolute uri and IP address from which this REST API being consumed.
When i am doing testing it locally as per below then it gives me URL of REST API itself instead of application from where it is consuming.
string str = RequestContext.AbsoluteUri.ToString();
Please how can i get details about source from where my REST API is consuming.
Thanks in Advance.
I'm not sure I understand this question correctly, do you want the referrer url? or physical location path? Either way the Original ASP.NET request object should have all the information you need which you can access in your webservice with:
var aspnetReq = (HttpRequest)RequestContext.Get<IHttpRequest>().OriginalRequest;
Which you can use to access all information about the request.

Resources