Closed apparecidoo closed 4 months ago
Hi @apparecidoo Thanks for reporting.
I tried decoding the example polyline with latest version of both JS and dotnet and got following results: JS: 231 points, length 5752.81073851163 Dotnet: 231 points, length 5752.8107385104295 I got the same number of points and the lengths are quite close with your code for distance calculation.
Would you please double check if this is also the case on your side, Thanks
Best, Haifeng
Thanks for replying and helping, I've check and I had an error in the code when I handled multiple polylines.
Hello,
I'm having issues with this decoder polyline, the backend is calculating a different result of coordinates. The backend (dotnet) is generating more coordinates than the frontend (javascript) and it's affecting my calculations of distance. So, in frontend and backend there is a need to calculate the total length of this polyline, but they are generating different points and I'm using the same formula to calculate distances in both places.
Polyline: B2FolvpyD2q71U03B3F5pBT7BvWAzFv5BTnB3NAvC3hBA7BvjCATvMAnBn4BTnBzyBAU3_BTAnfAwC77CT4Dn2CoBnBvtCoBjDr7BUjDrnBU7Gr2BUnL3_BoB7L3kC8B3InuBoBzFjwBoB3Dz8BoBAvlBoBArEAoBrdUA7GA8BjcU8BvlBU4DrTAU3DAoBjIA8BjSA4D_nBT8BjSA8B7QAwCrOAwCjNT4DvMAsE3IAsEzFAgFjDA4D7BT4DnBAoB8BA8BUA8BTAoBnBAoBvCTU3DAArEAoB3IAU3IAA3IATzKAnB7LAvCjSAjDnaArEzoBUnGr7BUvHnnC8B7BrOAnB7GAvC4DAnG4IAzU0eUrJ8LA3IoLU_EoGAnB8LAnB0KAAwMAA8GAoBwbToBoVTUgUTwC0UA8BgKAwCgKAkDwMAwH4cAkD8QA8BoQAoBwRAUgUTA8QATkSAnBofAnB8zBA3D0tBAjDgtBTnG4zC7BjD0mC7BAouBnBoBoVTwCkmBnBwH0yBnB4IsxBTkNw-BnBgKo4BnBoG0tBT4D0jBTwCofAwC4_BnBTgoBAnBgzDUT46BAU89BUwC87CU8BgeAsEo9BUsEozBAwC4XA0F8uBU8B0PC8B8LAgFgjBAkDsTA8B0KAkIouBUoBgFAkN8iCAoQ0mCUsE8QA0KgtBUsOsgCoBsOk6BoB4N0mCoBsEsYU8G8pBoBgPg_C8B0Kw-B8BoL46BoBgKwvBoB0FsYUkDkNUgP03BoBoQk1BoBUsOU8BkNAkD8LU0KgjBoBwH0ZU4IwboBoG4SU4I4XU8G8QUoGsOUkIkXoB0F0PUsE4NUwCgKUwC8LAoBgKUU8LUToLUT8LATsJUAsJAA4DUUsEAnB0KAnB8GU7B4DAvC8BAjDUAjD7BA_ErEUzFnLAzF3NUnL7aAjDvHArE_JAvM_dArJvWUvHnQAvH_OA_E3IA7G7LU7GzKArEnGA_J_OUrJzPAnLnVUvMzZoB7LrYUzKvWU_EzKAvH7QAjIvRU3DzKAnBjDArE7LAjD3IAjD3IAT7BAnB7BAnBTAnBAAnBoBAnBwCUTkDAAsEAUwCArEsEA3DgFAvM8QAnG4DUUoLAkDwHA4DTAgKrOU4DnBAoGTAgF0FA4D0FUgKoVA4SkmBoBkrBg6CvC8VgyBnBoGsTToBgPA3DoLA_EgUUU8VA3IsTAjI7BoBnG4DUjDnBU7BrEUWhIU
Javascript code for decoder: https://github.com/heremaps/flexible-polyline/blob/master/javascript/index.js Dotnet code for decoder: https://github.com/heremaps/flexible-polyline/blob/master/dotnet/src/PolylineEncoderDecoder.cs
Difference of results between, getting 3.5 km of difference: Javascript: 231 points with total length 5752.81073851163 meters Dotnet: 320 points with total length 9345.472837660183 meters
Code used for distance calculation:
Javascript
Dotnet
Thanks!