Skip to content

Commit

Permalink
Node mapping utility can now fully import json files. Nodes with id <…
Browse files Browse the repository at this point in the history
… 10000 have blue icons.
  • Loading branch information
Nick King committed Jun 3, 2013
1 parent 0117242 commit 65297c5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
7 changes: 6 additions & 1 deletion GuideWebsite/js/nodeMapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ function removePolyline(id1, id2) {
}

function writeJSON() {
console.log(JSON.stringify(nodes.slice(STARTING_NODE_ID)));
var json = "[";
for (var i in nodes) {
json += JSON.stringify(nodes[i]) + ",";
}
json += "]";
console.log(json);
}

// Reads the data from the savedNodes object if it is defined and resets the
Expand Down
5 changes: 2 additions & 3 deletions GuideWebsite/js/nodes.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions scripts/place_to_nodes_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
for place in placeslist:
node = {}
node["id"] = place["id"]
node["latitude"] = place["latitude"]
node["longitude"] = place["longitude"]
node["lat"] = place["latitude"]
node["lng"] = place["longitude"]
node["neighbors"] = []
nodeslist.append(node)

# insert a place holder in preparation for the rest of the dataset
last = {}
last["id"] = 9999
last["latitude"] = 0
last["lomgitude"] = 0
last["neighbor"] = []
last["lat"] = 0
last["lng"] = 0
last["neighbors"] = []
nodeslist.append(last)

# Dump everything in a new file named nodes.json
Expand Down

0 comments on commit 65297c5

Please sign in to comment.