How to translate OSM node ids to HERE node ids? - here-api

I have part of an OSM way between two OSM node ids 5264306189 and 5264306190 (taken from openstreetmap) as you can see in the image below.
What would be the equivalent node ids, or what is the right way to translate/represent this in a HERE map and how?
This is the GeoJSON line string that i've used to visualize the line
{
"type": "LineString",
"coordinates": [[
101.1929014, 54.4496526],
[101.1937758, 54.4494843]
]
}

Currently HERE does not support a way to translate OSM node ids to HERE Link ID or vice versa.

Related

How to assign specific colors to each datagroup in Gremlin?

%%gremlin -g Datagroup
Currently, I have my vertex colored and grouped via a 'datagroup' property.
Is there a way to assign specific colors to each datagroup(property) in AWS Neptune gremlin?
You can have different colors, or even icons for the nodes, assigned. There are examples in the sample notebooks that are part of the graph-notebook project. For example if you look in the /Neptune/02-Visualization/Grouping-and-Appearance-Customization-Gremlin notebook, you will see this example:
%%graph_notebook_vis_options
{
"groups": {
"['CA']": {"color": "red"},
"['MX']": {"color": "rgba(9, 104, 178, 1)"},
"['US']": {"color": "#00FF00"}
}
}
Followed by
%%gremlin -p v,inv -g country
g.V().hasLabel('airport').has('code','CZM').out('route').path().by(valueMap())
There are additional examples in the /Neptune/02-Visualization/Air-Routes-Gremlin notebook.

In Artifactory, can I modify the target paths for AQL download results like I can when using patterns and placeholders?

Is there a way to perform path manipulation against AQL results? i.e. similar to how Placeholders can be used to modify a pattern's results when assigning the target path.
I am attempting to download files from a repository like so:
my-generic-repository/myFolder/mySubfolder/(*)
...becomes...
C:\my\crazy\new\location\{1}
...recursively, with the portion of the tree in (*) preserved as {1}.
My download spec looks like:
{
"files": [
{
"aql": {
"items.find": {
"repo": "my-generic-repository",
"path": {
"$match": "myFolder/mySubFolder/*"
}
}
},
"flat": "false",
"recursive": "true"
}
]
}
To run the query I do this:
cd C:\my\crazy\new\location
jfrog rt download --spec=MySpecFile.txt --include-dirs=true --quiet=true
I observe the following file-tree:
C:\my\crazy\new\location\myFolder\mySubfolder\...
...but I want the following file-tree:
C:\my\crazy\new\location\...
Setting flat=true causes the repository's contents to be flattened completely and all files drop into C:\my\crazy\new\location without their hierarchy, which is not useful to me either.
(I'll add more AQL query complexity once I get the basic download to work, which is why I wish to use AQL and not 'pattern')
(side-note: I only get the files that are one subfolder deep or deeper within the specified path, not the files located exactly in the specified path, which is also making me scratch my head)

Road Label Layer in HERE Maps API for JavaScript

I'm attempting to add a vector map to a webpage using HERE Maps API for JavaScript. I've been using the style code below to render a super minimal style akin to the 4th picture from the top at this link (the one with only road and water area layers).
sources:
omv:
type: OMV
max_zoom: 17
min_display_zoom: 1
# global description of the map, in this example
# the map background color is white
scene:
background:
color: [1.000, 1.000, 1.000, 1.00]
# section contains the style information for the layers
# that are present on the map
layers:
# user defined name of the rendering layer
water_areas:
# the section defines where the rendering layer takes
# its data from source: omv is mandatory for the Vector Tile API
# layer: water specifies what vector layer is taken
# for the rendering see REST API documentation for the
# list of available layers.
data: {source: omv, layer: water}
# section defines how to render the layer
draw:
polygons:
order: 1 # z-order of the layer
color: [0.055, 0.604, 0.914, 1.00]
road:
data: {source: omv, layer: roads}
draw:
lines:
order: 2
color: [0.561, 0.561, 0.561, 1.00]
width: 15
It wasn't difficult to figure out how to add things like geoshape overlays and UI controls and panning, but the one thing I haven't been able to add successfully is road labels. (Which seems like it'd be quite easy.)
I've attempted to grab code for road label layers from other documentation examples, but it always breaks the map (leaving only my geoshapes on a white background). This may be because there's always global variable attached to the label's language or fill color, but when I attempt to bring in all the global variable settings and references, the map is still broken.
So my question is, does anyone know of a simple/foolproof way to add road labels to a HERE map with such a minimal style? I suppose I'm looking for the minimum attributes necessary to make that layer visible. Thanks!
To better way to rework (delete section/add yours) vector styles to utilize the online editor Map Style editor (it allows you see changes immediately) and after that load reworked style yaml file in your web app like:
function setStyle(map) {
// get the vector provider from the base layer
var provider = map.getBaseLayer().getProvider();
// Create the style object from the YAML configuration.
// First argument is the style path and the second is the base URL to use for
// resolving relative URLs in the style like textures, fonts.
// all referenced resources relative to the base path https://js.api.here.com/v3/3.1/styles/omv.
var style = new H.map.Style('URL/to/your.yaml',
'https://js.api.here.com/v3/3.1/styles/omv/');
// set the style on the existing layer
provider.setStyle(style);
}
See please the example on https://jsfiddle.net/qw64zL85/
There is using this yaml example file with road_labels: there only yaml text

Neo4J and Cypher query

I am new to Neo4j and Cypher query.My create query is like each Shop has 2 chillers which has 2 PLCs each which in turn has 2 sensors each.
The create is as below
Create(:SHOP{name:"Shop1"})-[:hasChiller]->(:CHILLER{name:"Chiller1"})
Create(:SHOP{name:"Shop1"})-[:hasChiller]->(:CHILLER{name:"Chiller2"})
Create(:SHOP{name:"Shop2"})-[:hasChiller]->(:CHILLER{name:"Chiller3"})
Create(:SHOP{name:"Shop2"})-[:hasChiller]->(:CHILLER{name:"Chiller4"})
Create(:CHILLER{name:"Chiller1"})-[:hasPLC]->(:PLC{name:"Plc1"})
Create(:CHILLER{name:"Chiller1"})-[:hasPLC]->(:PLC{name:"Plc2"})
Create(:CHILLER{name:"Chiller2"})-[:hasPLC]->(:PLC{name:"Plc3"})
Create(:CHILLER{name:"Chiller2"})-[:hasPLC]->(:PLC{name:"Plc4"})
Create(:CHILLER{name:"Chiller3"})-[:hasPLC]->(:PLC{name:"Plc5"})
Create(:CHILLER{name:"Chiller3"})-[:hasPLC]->(:PLC{name:"Plc6"})
Create(:CHILLER{name:"Chiller4"})-[:hasPLC]->(:PLC{name:"Plc7"})
Create(:CHILLER{name:"Chiller4"})-[:hasPLC]->(:PLC{name:"Plc8"})
Create(:PLC{name:"Plc1"})-[:hasSensor]->(:SENSOR{name:"Sensor1"})
Create(:PLC{name:"Plc1"})-[:hasSensor]->(:SENSOR{name:"Sensor2"})
Create(:PLC{name:"Plc2"})-[:hasSensor]->(:SENSOR{name:"Sensor3"})
Create(:PLC{name:"Plc2"})-[:hasSensor]->(:SENSOR{name:"Sensor4"})
Create(:PLC{name:"Plc3"})-[:hasSensor]->(:SENSOR{name:"Sensor5"})
Create(:PLC{name:"Plc3"})-[:hasSensor]->(:SENSOR{name:"Sensor6"})
Create(:PLC{name:"Plc4"})-[:hasSensor]->(:SENSOR{name:"Sensor7"})
Create(:PLC{name:"Plc4"})-[:hasSensor]->(:SENSOR{name:"Sensor8"})
Create(:PLC{name:"Plc5"})-[:hasSensor]->(:SENSOR{name:"Sensor9"})
Create(:PLC{name:"Plc5"})-[:hasSensor]->(:SENSOR{name:"Sensor10"})
Create(:PLC{name:"Plc6"})-[:hasSensor]->(:SENSOR{name:"Sensor11"})
Create(:PLC{name:"Plc6"})-[:hasSensor]->(:SENSOR{name:"Sensor12"})
Create(:PLC{name:"Plc7"})-[:hasSensor]->(:SENSOR{name:"Sensor13"})
Create(:PLC{name:"Plc7"})-[:hasSensor]->(:SENSOR{name:"Sensor14"})
Create(:PLC{name:"Plc8"})-[:hasSensor]->(:SENSOR{name:"Sensor15"})
Create(:PLC{name:"Plc8"})-[:hasSensor]->(:SENSOR{name:"Sensor16"})
However the Match to get the sensors under SHOP1
MATCH(s:SHOP{name:"Shop1"})-[:hasChiller]->(cc:CHILLER)-[:hasPLC]->(pp:PLC)-[:hasSensor]->(ss:SENSOR) return ss.name
returns nothing.Says no changes and no data.
I am trying this out on Neo4J sandbox environment.I did this based on the understanding i had using match clause in SQL SERVER GRAPH 2019 where this works.
Can anyone point out where i am going wrong?
You are improperly creating multiple instances of the "same" node. You should create each node once, and then use its bound variable name later on when you need to create relationships involving that node.
Delete all your data and follow this pattern instead (you have to fill in the "..." parts):
CREATE
(sh1:SHOP{name:"Shop1"}), (sh2:SHOP{name:"Shop1"}),
(c1:CHILLER{name:"Chiller1"}), (c2:CHILLER{name:"Chiller2"}),(c3:CHILLER{name:"Chiller3"}), (c4:CHILLER{name:"Chiller4"}),
(p1:PLC{name:"Plc1"}), ..., (p8:PLC{name:"Plc8"}),
(se1:SENSOR{name:"Sensor1"}), ..., (se16:SENSOR{name:"Sensor16"}),
(sh1)-[:hasChiller]->(c1), (sh1)-[:hasChiller]->(c2),
... // create remaining relationships using bound variable names for nodes

By-step with groovy does not extract values for some node

The problem is described as following:
I want to find some interested paths and get corresponding properties of vertices or edges, the groovy I used is as following:
g.V().has("p_v_name", "d8e5d39d63c580acdb3eb188a1f4a942").
repeat(__.bothE().otherV().simplePath()).
times(3).emit().
has('p_v_tag').
path().
by(
__.project("label", "id", "p_v_black_tag").
by(__.label()).
by(__.id()).
by(__.choose(__.has('p_v_tag'),
__.properties('p_v_tag').project('value').by(__.value()).fold(),
__.constant([])
)
)
).unfold()
The above code gives me following result:
==>[label:v_user_key,id:749577404608,p_v_tag:[[value:PR016],[value:PR033],[value:PR068]]]
==>[label:e_application_id,id:4jjrk79js-9kcn170g-8ph-nvxhl4s0,p_v_tag:[]]
==>[label:v_application_id,id:1871880949872,p_v_tag:[]]
The result is unfolded for easing reading. It's just a path consisted of two nodes and one edge. The source node has a property p_v_tag, it's of multi-properties. The problem is the target node also has the property p_v_tag, but the code does not output the values.
I checked the target node has the property p_v_tag and it's not empty as following:
gremlin> g.V(1871880949872).properties('p_v_tag')
==>vp[p_v_tag->outdated]
I read the document(http://tinkerpop.apache.org/docs/current/reference) over and over but I can't figure out how to make it right, can any body help me or give me some advice?
I'm not sure why that wouldn't work. What happens if you try this workaround to replace:
by(__.choose(__.has('p_v_tag'),
__.properties('p_v_tag').project('value').by(__.value()).fold(),
__.constant([])
)
with:
by(coalesce(properties('p_v_tag').
project('value').
by(__.value()).
fold(),
constant([]))

Resources