Open xyzhieu opened 1 year ago
they are the same but reverse order?
yes, I found out when encode with 7 digits, the above case number overflows
yeah because we use 32bits internally per coordinate. this is not a bug really it wasn't meant to support arbitrary precision it was really for switching between 5 and 6 digits
I suppose if there is no performance penalty we could use 64bit integers. we'll have to test it
We could also test vendoring this one: https://github.com/vahancho/polylineencoder.
i would vote against vendoring:
I need help. When decode and encode the following test case i don't get the desired result.
//vCoords_Case != vCoords_Test [0] = (107.3749770, 11.5833730) [1] = (107.3739679, 11.5830050) [2] = (107.3729499, 11.5825950) [3] = (107.3727600, 11.5825169)
//vCoords_Case == vCoords_Test [0] = (107.3727600, 11.5825169) [1] = (107.3729499, 11.5825950) [2] = (107.3739679, 11.5830050) [3] = (107.3749770, 11.5833730)
std::string shapeText = valhalla::midgard::encode(vCoords_Case ,1e7); auto vCoords_Test = valhalla::midgard::decode<std::vector<std::pair<double, double>>>(shapeText ,1e-7);