Closed duanshuai007 closed 1 year ago
hello , i find in compactor.js
function compactGraph(vertices, vertexCoords, edgeData, options) {
options = options || {};
var progress = options.progress;
var ends = Object.keys(vertices).reduce(function findEnds(es, k, i, vs) {
var vertex = vertices[k];
var edges = Object.keys(vertex);
var numberEdges = edges.length;
var remove;
console.log("edges = " + numberEdges);
if (numberEdges === 1) {
var other = vertices[edges[0]];
remove = !other[k];
} else if (numberEdges === 2) {
remove = edges.filter(function(n) {
return vertices[n][k];
}).length === numberEdges;
} else {
remove = false;
}
if i modify like this
if (numberEdges === 1) {
var other = vertices[edges[0]];
remove = !other[k];
} else if (numberEdges === 2) {
// remove = edges.filter(function(n) {
// return vertices[n][k];
// }).length === numberEdges;
} else {
i will find the shortest way right. but i can't understand the code do what.
can i delete this code? it will generate a big mistake? thank you .
Hi @duanshuai007,
This I think is related to issue #27 and pull request #64.
Try my fork, which incorporates the pull request: https://github.com/nickw1/geojson-path-finder
Does that work for you?
Thanks for this info, guys, and sorry I did not get to this sooner.
As part of the 2.0 update, I added a test for the test case provided above (with slight modifications, hope I got it right). This test now passes, presumably since #27 was merged.
hello,i create a geojson map file,and i want get the a->b shortest path,
but i always get the result like this.
my test code:
my geojson file :
i want to know where i am wrong. thank you.