I used the lineair distance matrix tool in QGIS 2.6 My coordination system is metric (national Dutch RD new) The results have the wrong decimals, as shown below. How can I fix this? (showing unique distances only)

InputID TargetID    Distance by matrix  real distance   
3   2   914.753.872.032 914     meter
3   1   119.476.303.875 1,19    km
4   1   156.770.528.678 1,56    km
4   3   162.709.997.483 1,62    km
4   2   226.796.645.372 2,26    km
6   5   241.698.218.226 2,41    km
6   3   614.677.367.185 6,14    km
6   4   631.106.480.203 6,31    km
6   2   693.828.353.563 6,93    km
6   1   723.724.716.201 7,23    km
2   1   105.868.974.731 1,05    km
5   3  3,8     km
5   4   390.398.472.686 3,9     km
5   2   46.440.219.167  4,64    km
5   1   484.470.336.769 484     meter
  • 1
    What is the language of your system locale (Settings->Options->Locale)? What is the detected active locale on your system? – xunilk Mar 27 '15 at 10:35
  • I've just checked, that's both Dutch. Seems fine, right? – Anna Mar 27 '15 at 14:54

I didn't know that the Netherlands is one of the countries that also uses arabic numerals with decimal comma (http://en.wikipedia.org/wiki/Decimal_mark). For this reason, it looks like as a locale problem. In Spain (which also uses decimal comma), to avoid locale problems, I use my QGIS with U.S.English language and "Override system locale" (Settings->Options->Locale).

To test correct operation of "distance matrix tool" in my system, I loaded a point vector layer in QGIS and ran the tool.

enter image description here

I printed my distance matrix as csv file where I selected the first record for verification purpose (in red):

enter image description here

In the next image I selected the points with id 0-4 and measured its distance with "Measure Line Tool". The result was comparable to the one in csv file.

enter image description here

  • Thank you, this works I guess. What I did was the other way around: in my computer settings: START, COMPUTER, CONTROL PANEL, DATE TIME LANGUAGE AND REGIONAL OPTIONS, CHANGE THE FORMAT OF NUMBERS DATES AND TIMES, REGIONAL OPTIONS, CUSTOMIZE, NUMBERS: DECIMAL SYMBOL = point & DIGIT GROUPING SYMBOL= comma. Perfect .csv output tables! – Anna Mar 30 '15 at 14:02

Did you open the csv with a text editor or with Excel? Excel gets confused with delimter commas, thousand points and decimal commas; depending on your computers locale.

If you replace the delimiter comma by semicolons, it should work. A good text editor like notepad++ for Windows can do this easily.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.