MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / addNode

Function addNode

features/step_definitions/data.js:55–66  ·  view source on GitHub ↗
(name, ri, ci)

Source from the content-addressed store, hash-verified

53
54Given(/^the node map$/, function (docstring, callback) {
55 const addNode = (name, ri, ci) => {
56 const lonLat = this.tableCoordToLonLat(ci, ri);
57 if (name.match(/[a-z]/)) {
58 if (this.nameNodeHash[name])
59 throw new Error(util.format('*** duplicate node %s', name));
60 this.addOSMNode(name, lonLat[0], lonLat[1], null);
61 } else if (name.match(/[0-9]/)) {
62 if (this.locationHash[name])
63 throw new Error(util.format('*** duplicate node %s', name));
64 this.addLocation(name, lonLat[0], lonLat[1], null);
65 }
66 };
67
68 docstring.split(/\n/).forEach((row, ri) => {
69 row.split('').forEach((cell, ci) => {

Callers 1

data.jsFile · 0.85

Calls 7

tableCoordToLonLatMethod · 0.80
addOSMNodeMethod · 0.80
findNodeByNameMethod · 0.80
setIDMethod · 0.80
matchMethod · 0.45
addLocationMethod · 0.45
addTagMethod · 0.45

Tested by

no test coverage detected