Retrieving previously calculated route [HERE Maps] using RouteeId fails with RouteNotReconstructed error - here-api

I'm calculating routes based on user input. Then storing the routeId and any additional informations I need. But the shape of the road is something I need occasionally; when the user wants to get a preview of the road again.
Since I don't want to store all the points from shape I tried using getroute endpoint (https://developer.here.com/documentation/routing/topics/resource-get-route.html#resource-get-route) but I get this response:
{
"_type": "ns2:RoutingServiceErrorType",
"type": "ApplicationError",
"subtype": "RouteNotReconstructed",
"details": "Error is NGEO_ERROR_ROUTE_DESERIALIZATION",
"additionalData": [
{
"key": "error_code",
"value": "NGEO_ERROR_ROUTE_DESERIALIZATION"
}
],
"metaInfo": {
"timestamp": "2018-08-01T15:01:56Z",
"mapVersion": "8.30.86.150",
"moduleVersion": "7.2.201830-34436",
"interfaceVersion": "2.6.34",
"availableMapVersion": [
"8.30.86.150"
]
}
}
So the question is: why do I get the error? Following the API documentation https://developer.here.com/documentation/routing/topics/resource-type-error-route-not-reconstructed.html I can exclude wrong routeId (it works for routes saved e.g. today but not for the older ones).
The route was calculated using the same version (7.2)
Is the routeId stored only for a certain amount of time?
If so, how long?

RouteID changes with map version.
https://developer.here.com/documentation/routing/topics/request-route-information.html
You'd need to recalculate periodically to get up to date RouteIDs.

Related

Field SCREEN_VIEW is not a valid dimension

I'm using firebase analytics with my android app.
I followed this article https://firebase.google.com/docs/analytics/screenviews?hl=en and now I'm tracking screens manually.
As you can see below it's working
Now I try to retrieve this data with the runReport-method https://developers.google.com/analytics/devguides/reporting/data/v1/rest/v1alpha/TopLevel/runReport as follows
{
"dimensions": [{
"name": "screen_view"
},
{
"name": "firebase_screen"
}
],
"metrics": [{
"name": "myMetric?"
}]
}
I get the return message
Field screen_view is not a valid dimension
I don't know what I'm doing wrong.
Here's your reference of all the dimensions and APIs you can use: https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema
I think what you're having issues with is that the "screen_view" dimension doesn't exist. This is because if you go into your Firebase Console. "screen_view" is actually an EVENT.
So in your case, to solve, you would actually have to get the dimension "eventName" and FILTER for the "screen_view" name.

calculateroute.json giving NGEO_ERROR_GRAPH_DISCONNECTED error

So when I try to call calculateroute.json, I'm getting a NGEO_ERROR_GRAPH_DISCONNECTED error with no further information.
Here's my example call: https://route.api.here.com/routing/7.2/calculateroute.json?app_id=<APP_ID>&app_code=<APP_CODE>&waypoint0=geo!-34.0144128,151.1121957&waypoint1=geo!-33.875455,151.207583&mode=fastest;car;traffic:enabled&departure=2019-11-11T22:27:30
Obviously I've removed our App ID and App Code from that call :).
{
"_type": "ns2:RoutingServiceErrorType",
"type": "ApplicationError",
"subtype": "NoRouteFound",
"details": "Error is NGEO_ERROR_GRAPH_DISCONNECTED",
"additionalData": [
{
"key": "error_code",
"value": "NGEO_ERROR_GRAPH_DISCONNECTED"
}
],
"metaInfo": {
"timestamp": "2019-11-08T00:43:18Z",
"mapVersion": "8.30.102.150",
"moduleVersion": "7.2.201944-5674",
"interfaceVersion": "2.6.74",
"availableMapVersion": [
"8.30.102.150"
]
}
}
Any ideas?
I've tried looking through the docs but it seems I've done everything right and certainly it has worked for us hundreds/thousands of times before.
Indeed, I see the default Routing API does not find a direct route between the start and end waypoints. If you use our advanced Fleet telematics API, it does actually calculates the route.
https://fleet.api.here.com/2/calculateroute.json?app_id=<APP_ID>&app_code=<APP_CODE>&waypoint0=geo!-34.0144128,151.1121957&waypoint1=geo!-33.875455,151.207583&mode=fastest;car;traffic:enabled&departure=2019-11-11T22:27:30
Please use the advanced API if the standard API does not return results.

HERE Routing API - How to use publicTransportTimeTable mode with multiple waypoints using calculate route resource?

I'm using calculateroute resource to calculate a route between multiple waypoints.
https://route.api.here.com/routing/7.2/calculateroute.json?app_id={APP_ID}&app_code={APP_CODE}&waypoint0=-25.4327193,-49.2806026;;0&waypoint1=-25.4392733,-49.2722581;;1&waypoint2=-25.4367652,-49.2833011;;2&waypoint3=-25.4327193,-49.2806026;;3&waypoint4=-25.4327193,-49.2806026;;4&waypoint5=-25.4392733,-49.2722581;;5&departure=2019-09-09T07:10:00-03:00&mode=fastest;car;traffic:disabled;motorway:0&improveFor=distance&language=pt-br&representation=navigation&metricSystem=metric&vehicletype=diesel,5.5
I was using departure parameter to set the initial date of the route, but now, instead of departure, I need to use arrival time in some cases. I was using car mode, but as arrival parameter requires publicTransportTimeTable, I set it this way.
https://route.api.here.com/routing/7.2/calculateroute.json?...&mode=fastest;publicTransportTimeTable;motorway:0..
Then the return was this error message: "Time Table Transit Routing is only supported for two StopOver waypoints", then I set the waypoint0 and waypoint5 as stopOver and the rest as passThrough, and yet, I receive the same error.
GET REQUEST
https://route.api.here.com/routing/7.2/calculateroute.json?app_id={APP_ID}&app_code={APP_CODE}&waypoint0=stopOver!-25.4327193,-49.2806026;;0&waypoint1=passThrough!-25.4392733,-49.2722581;;1&waypoint2=passThrough!-25.4367652,-49.2833011;;2&waypoint3=passThrough!-25.4327193,-49.2806026;;3&waypoint4=passThrough!-25.4327193,-49.2806026;;4&waypoint5=stopOver!-25.4392733,-49.2722581;;5&arrival=2019-09-09T07:10:00-03:00&mode=fastest;publicTransportTimeTable;motorway:0&improveFor=distance&language=pt-br&representation=navigation&metricSystem=metric&vehicletype=diesel,5.5
RETURN
{
"_type": "ns2:RoutingServiceErrorType",
"type": "ApplicationError",
"subtype": "InvalidInputData",
"details": "Time Table Transit Routing is only supported for two StopOver waypoints",
"additionalData": [
{
"key": "waypoint",
"value": ""
}
],
"metaInfo": {
"timestamp": "2019-09-10T13:40:27Z",
"mapVersion": "8.30.99.156",
"moduleVersion": "7.2.201935-5091",
"interfaceVersion": "2.6.68",
"availableMapVersion": [
"8.30.99.156"
]
}
}
as stated in the documentation, you can only use the arrival parameter when mode is set to publicTransportTimeTable. And this type of routing currently supports only two stopover waypoints (waypoint0 and waypoint1) and no passthrough waypoints.

How to get notifications that have Edge date property greater than last visited date in Titan using Gremlin?

I'm having user vertices which have incoming Notification edges as follows:
code am using to get notifications
g.v(17929472).outE('Notification')
Response I'm getting :
{
"success": true,
"results": [
{
"Type": "UserReaction",
"PostedDate": "2016-04-15T09:03:42.8391677Z",
"NotificationInitiatedByVertexId": "2304",
"_id": "c7bb4-aoagw-sgl-aoao0",
"_type": "edge",
"_outV": 17929472,
"_inV": 17929728,
"_label": "Notification"
}
],
"version": "2.5.0",
"queryTime": 15.310751
}
Whenever user view the notification i'm saving the last seen date and want to use that date to get all notification that is present after that date.
I've tried :
g.v((5124096).outE).outE.has('PostedDate',T.gte, 2016-04-15T07:52:31.6979843Z).inV
but it is giving error.
PostedDate appears to be returned as a String. Consider defining PostedDate in your schema definition as a Long instead, and then do the T.gte comparison with a Long value.

Google Cloud Datastore runQuery returning 412 "no matching index found"

** UPDATE **
Thanks to Alfred Fuller for pointing out that I need to create a manual index for this query.
Unfortunately, using the JSON API, from a .NET application, there does not appear to be an officially supported way of doing so. In fact, there does not officially appear to be a way to do this at all from an app outside of App Engine, which is strange since the Cloud Datastore API was designed to allow access to the Datastore outside of App Engine.
The closest hack I could find was to POST the index definition using RPC to http://appengine.google.com/api/datastore/index/add. Can someone give me the raw spec for how to do this exactly (i.e. URL parameters, what exactly should the body look like, etc), perhaps using Fiddler to inspect the call made by appcfg.cmd?
** ORIGINAL QUESTION **
According to the docs, "a query can combine equality (EQUAL) filters for different properties, along with one or more inequality filters on a single property".
However, this query fails:
{
"query": {
"kinds": [
{
"name": "CodeProse.Pogo.Tests.TestPerson"
}
],
"filter": {
"compositeFilter": {
"operator": "and",
"filters": [
{
"propertyFilter": {
"operator": "equal",
"property": {
"name": "DepartmentCode"
},
"value": {
"integerValue": "123"
}
}
},
{
"propertyFilter": {
"operator": "greaterThan",
"property": {
"name": "HourlyRate"
},
"value": {
"doubleValue": 50
}
}
},
{
"propertyFilter": {
"operator": "lessThan",
"property": {
"name": "HourlyRate"
},
"value": {
"doubleValue": 100
}
}
}
]
}
}
}
}
with the following response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "FAILED_PRECONDITION",
"message": "no matching index found.",
"locationType": "header",
"location": "If-Match"
}
],
"code": 412,
"message": "no matching index found."
}
}
The JSON API does not yet support local index generation, but we've documented a process that you can follow to generate the xml definition of the index at https://developers.google.com/datastore/docs/tools/indexconfig#Datastore_Manual_index_configuration
Please give this a shot and let us know if it doesn't work.
This is a temporary solution that we hope to replace with automatic local index generation as soon as we can.
The error "no matching index found." indicates that an index needs to be added for the query to work. See the auto index generation documentation.
In this case you need an index with the properties DepartmentCode and HourlyRate (in that order).
For gcloud-node I fixed it with those 3 links:
https://github.com/GoogleCloudPlatform/gcloud-node/issues/369
https://github.com/GoogleCloudPlatform/gcloud-node/blob/master/system-test/data/index.yaml
and most important link:
https://cloud.google.com/appengine/docs/python/config/indexconfig#Python_About_index_yaml to write your index.yaml file
As explained in the last link, an index is what allows complex queries to run faster by storing the result set of the queries in an index. When you get no matching index found it means that you tried to run a complex query involving order or filter. So to make your query work, you need to create your index on the google datastore indexes by creating a config file manually to define your indexes that represent the query you are trying to run. Here is how you fix:
create an index.yaml file in a folder named for example indexes in your app directory by following the directives for the python conf file: https://cloud.google.com/appengine/docs/python/config/indexconfig#Python_About_index_yaml or get inspiration from the gcloud-node tests in https://github.com/GoogleCloudPlatform/gcloud-node/blob/master/system-test/data/index.yaml
create the indexes from the config file with this command:
gcloud preview datastore create-indexes indexes/index.yaml
see https://cloud.google.com/sdk/gcloud/reference/preview/datastore/create-indexes
wait for the indexes to serve on your developer console in Cloud Datastore/Indexes, the interface should display "serving" once the index is built
once it is serving your query should work
For example for this query:
var q = ds.createQuery('project')
.filter('tags =', category)
.order('-date');
index.yaml looks like:
indexes:
- kind: project
ancestor: no
properties:
- name: tags
- name: date
direction: desc
Try not to order the result. After removing orderby(), it worked for me.

Resources