Swapping x and y coordinates

Z Solvertech
Verze z 16. 8. 2022, 07:19, kterou vytvořil Jana.safferova (diskuse | příspěvky) (založena nová stránka s textem „'''Correction within''' [https://wiki.solvertech.cz/wiki/TAS:Pokro%C4%8Dil%C3%A9/Pluginy/Input,_Output/Import/ScenarioImporter '''ScenarioImporter'''] '''(the client supplies non-valid data)'''“)
(rozdíl) ← Starší verze | zobrazit aktuální verzi (rozdíl) | Novější verze → (rozdíl)
Skočit na navigaci Skočit na vyhledávání
Jiné jazyky:

After user intervention (manual addition of coordinates) it sometimes happens that the x and y coordinates are swapped, which makes it impossible to calculate the distance matrix.

Note: In the context of Central Europe, the x-coordinate will always be smaller than the y-coordinate.

Manual correction:

  1. In the " Locations" tab, select the "X" and "Y" columns
  2. Sort the Y column by size - the location with the swapped coordinate will be first
  3. Copy the values in the X and Y columns into a auxiliary file (word, excel, notepad, whatever)
  4. Copy the value from column Y (from the auxiliary file) into column X - it is a smaller number (16,xxxx etc.) and press ENTER
  5. Copy the value from column X (from the auxiliary file) into column Y - it is a larger number (49,xxxx etc.) and press ENTER
  6. Press "Update" to calculate the distances

Correction within ScenarioImporter (the client supplies non-valid data)

Basic: In the import data we receive GPS data from the client, but sometimes the x and y coordinates are swapped. The client's columns are named "gpsx" and "gpsy"

Solution: In ScenarioImporter you need to use the following code:

   1 <ColumnsCalculated>
2 <string>stop2;x;dynamic;gpsx;dynamic;gpsy;;dynamicgpsx<dynamicgpsy?dynamicgpsx:dynamicgpsy</string>
3 <string>stop2;y;dynamic;gpsx;dynamic;gpsy;;dynamicgpsx<dynamicgpsy?dynamicgpsy:dynamicgpsx</string>
4 </ColumnsCalculated>