There is a difference between the result of the Javascript API 'calculateRoute' function call from H.service.Platform.getRoutingService(null,8) (Javascript API version 3.1)
And the result of the iOS SDK 'calculateRoute' function from NMACoreRouter. (Premium sdk v 3.1.9)
If I pass in the options
routingType: fastest
transportMode: truck
And I pass in exactly the same set of waypoints.
E.g.
Stopover: -34.909797,138.5403
via: -34.85191,138.49499
via: -34.851,138.49494
via: -34.84965,138.49478
via: -34.84868,138.4947
via: -34.84765,138.49459
via: -34.84681,138.49448
via: -34.84654,138.49439
via: -34.84556,138.49392
via: -34.84252,138.49306
via: -34.84131,138.49272
Stopover: -34.827869,138.500708
Then the via waypoint that is on a bridge will make the javascript route drive down side roads to pass over the bridge. However the iOS API will continue to drive under the bridge.
Is there a way to make the two engines calculate identically?
Javascript:
iOS:
Both engines uses different routing APIs. So it is not possible to get identical results. The Premium sdk v 3.1.9 works on Routing V7 ,whereas the the javascripts works on routing v8.
https://developer.here.com/documentation/routing-api/dev_guide/index.html
Related
i'm updating our html5 website which is currently using maptiles v2.1 which is being discontinued.
we have updated geocoding, reverse geocoding, routing api calls all fine to the latest version using apikey instead of app_id and app_code.
the old url uses app_id and app_code in this format.
https://1.base.maps.api.here.com/maptile/2.1/maptile/newest/normal.day/18/130111/83381/256/png8?app_id=xxx&app_code=xxx
i've been trying to replace this with the raster tiles url in this format with the new apikey we have, ie:
https://maps.hereapi.com/v3/base/mc/7/66/42/png8?apikey=xxx
this is returning a 403 forbidden error: {"error":"Forbidden","error_description":"These credentials do not authorize access"}
the apikey works fine for the other api calls (geocode, routing, etc) but not this.
does our apikey not have access to the raster tiles api?
Thanks for choosing HERE, the raster tile V3 is not officially launched yet. We will update the info here once available: https://developer.here.com/documentation
I am using the following code to create a route using the Premium Android SDK:
RouteOptions ro = new RouteOptions();
ro.setTransportMode(RouteOptions.TransportMode.CAR);
ro.setRouteType(RouteOptions.Type.BALANCED);
ro.setRouteCount(1);
RoutePlan rp = new RoutePlan();
// start route on current position
rp.setRouteOptions(ro);
rp.addWaypoint(new RouteWaypoint(currentGeoCoordinate));
rp.addWaypoint(new RouteWaypoint(stopGeoCordinate));
DynamicPenalty dp = new DynamicPenalty();
dp.setTrafficPenaltyMode(TrafficPenaltyMode.OPTIMAL);
stopGeoCordinate = new GeoCoordinate(trip.getLatitude(), trip.getLongitude());
CoreRouter rm = new CoreRouter();
rm.setDynamicPenalty(dp);
rm.calculateRoute(rp, new CoreRouter.Listener() { ...
Using the Android Studio Network Profiler I have seen this single request result in about 30 of the same backend API calls to the following URL:
https://v154-105-30-8.route.hybrid.api.here.com/rt?.....
Is this the expected behavior so that a single traffic routing request results in 30 transactions, or am I doing something fundamentally incorrect?
As a follow up, the SDK team acknowledged there is a bug with SDK 3.14 (and possibly earlier).
When the NavigationManager is set to DYNAMIC traffic routing, if the route would go slightly off the path, it would immediately call the server for rerouting. In the example I created, a .5 mile trip resulted in 70 calls to the Server Routing API.
The SDK team stated this should only occur after 5 seconds but was not working properly. 3.15 should address this issue.
So, if anyone is using 3.14 (I am unsure about earlier versions) with the NavigationManager and DYNAMIC routing, check your transaction count as it may be much higher then expected.
I am trying to geocode some addresses with python
so I created a freemium account on https://developer.here.com
my code is this
(...)
here = Here(here_config.app_id, here_config.app_code, timeout=5)
here.geocode(string_to_geocode)
I am getting the following error message:
HTTP Error 401: Unauthorized
my doubt comes from the difference between the terms "app_code" on my code sample and "app_key" on my credential screen.
Is there another step I need to do in order to get a "app_code" or is my "app_key" already supposed to be it?
P.S. on that same screen Here provides me an option of getting JAVASCRIPT keys, HERE SDK FOR IOS (PREMIUM EDITION) [this option cleary has a button that says "generate app_key and app_code", however, I am not developing a cellphone app, but a python program.
What am I missing ?
here_credential_screen
App ID and App Code have been replaced. We encourage all users to switch to API Key or OAuth 2.0 (JSON Web Tokens) authentication. Please be aware that as part of adapting to the new authentication method, some endpoints have also changed.
please check the new domains here
You can either use your ApiKey or App_Id/App_Code.
for example like this-
https://geocoder.ls.hereapi.com/6.2/geocode.json?apiKey={YOUR_API_KEY}&searchtext=425+W+Randolph+Chicago
https://developer.here.com/documentation/geocoder/dev_guide/topics/quick-start-geocode.html
I am trying to test to send a charge.succeeded webhook to my endpoint but there's an error:
Received event with API version 2019-03-14, but Stripe.net 24.5.0 expects API version 2019-02-19 and when adding webhook in test mode you can only choose 2019-03-14 or 2018-11-08 version.
Obviously I'm using Stripe.net 24.5.0, I can't test my webhook because of this.
Does anyone have any idea how to fix this? Thank you.
Did you perhaps hardcode the API version to "2019-02-19" in your application?
You can downgrade your API key version to "2019-02-19" but you'll have to write into Stripe support to do that: https://support.stripe.com/contact
Update: I found the answer here.
You just need to set the throwOnApiVersionMismatch to false and it will not check the version if it's not the same.
sample code:
var event = EventUtility.ConstructEvent(
JSON,
Request.Headers["Stripe-Signature"],
_secret,
300,
(long)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds,
false);
EDIT: As stated by karllekko and in the link it is much safer to create a WebhookEndpoint with the API version forced to the same API version as the library, this can only be done via API and not in the dashboard.
Delete your current webhook and create a new webhook with the same url, but change the API version. Stripe 24.5.0 expects API version 2019-02-19 but you are supplying the default API which is 2018-11-08 in the webhook - which will throw an error.
Change to the required API and test your webhook again. This also goes for future API releases - be sure to use the latest API if you experience this error.
I am working thru the sample todolist application for the Cordova SDK.
the url is here
https://msdn.microsoft.com/en-us/library/dn832630.aspx
I set up a key on the BING Maps website. I can access the location service sending latitude and longitude thru a standard web browser, pasting in the URL with my key.
However the angular call always fails. What is worse is the error is always blank. no status code no error message. Was thinking it must be CORS.
I have run through the sample and downloaded the code sample and both have the same issue.
For anyone going thru the sample. I have realised today that Angular is evil. They say it is nicely testable javascript with dependancy injection, however it doesn't seem to be too interested in telling you what the error is when you have one, it just fails. Great and noble programming ideas, but without an error message it isn't much good.
Anyhow the fix is that Angular is very strict about json code so the line in services.js for the Bings Maps Service method getAddressFromPosition
it used to work with .get() but this was probably an old version of Angular when the demo was written. I tried using 1.2 but the Ripple emulator didn't like references to browser specific code. So I used the latest 1.3.13 I believe.
This is where to access the Bing location service with the Cordova geolocation coordinates returns Json, but Angular wants them wrapped in JSONP. searching the increasing fragmented web it appeared the error might be CORS no, so a many different people had their JSONP calls in controllers, modules, services, some using $http others $resources. Finally using bits and pieces I got JSONP to work with $resources and to plug it into the $promise the call from the controller requires. I used a static Url with Coordinates I knew worked, so you will have to use the :param angular notation to put those back in. Hope it helps someone.
So change to:
getAddressFromPosition: function (position) {
var resource = $resource(url, {}, {
jsonp_query: {
method: 'JSONP'
}
});
return resource.jsonp_query().$promise.then(function (response) {
return response.resourceSets[0].resources[0].address.formattedAddress;
}, function (error) {
return position.coords.latitude + "," + position.coords.longitude
});
edit:
I put the above in and it worked. However the problem was for some reason, perhaps thru debugging, another instance of the app was deployed on another port in ripple. This then change the app to run on this new port. The initial port was 4400. The problem is that and $http or $resource calls in angular have to go thru this emulator, and the emulator was seeing this as cross domain, unless it is configured to the same port the app is running under.
so Url:
http://localhost:4409/index.html?enableripple=cordova-3.0.0-iPhone5
then in the Settings Div dropdown on the right side, the Proxy Port must also be set to 4409 or else the browser will complain that the $http request is cross-domain, before the emulator actually executes it to query Azure mobile service or Bing maps.
So this was very frustrating. However VS Cordova has definately reduced the amount of bits you have to configure to make hybrid mobile apps, there are still little glitches like this which can trip you up. I assumed it was something with angular, because there was no error messages, but in Chrome in the Dev Tools console that was where the error was, and after some googling it was plain that it was the ripple emulator running on a different port than its proxy was not allowing the call to be forwarded on due to Access-Control-Allow not being set.