Whitebikes update of OSM data from CSV export
ارسالی از MiroJanosik در 1 اکتبر 2018 به English. آخرین بهروزرسانی در 3 اکتبر 2018.So I did update of the OSM data that we get as CSV export from WhiteBikes database. I had to take care of few troubles - export is not exactly CSV, data order differs, but at least they are consistent. I think it can’t be automated and changes should be reviewed, I did it by hand as I want to see which data modified. There are around 50 bike stands in the city.
So, lets see what did I have to do:
Prepare list of stands from database, in a format similar to previously retrieved data
- download new data from whitebikes at * censored *. In case that website is saved as HTML and not as pure text try to use view source + select all - copy - paste into file.
- It is in format of CSV (spreadsheet) that can be loaded into office if needed.
- But it is in incorrect format, so it has to be adapted beforehand.
- Replace all commas by dot. Replace all semicolons by comma.
- After this change it will be CSV (Comma-separated-values) and it can be used in excel.
-
Though, there may be still some issues - semicolons are sometimes used also in text, not only as separators.
- import into office spreadsheet editor (excel, calc) and make it nice and aligned by station number:
- add new first column, fill it with numbers 1-100
- set other columns for sorting, sort them by number (they may be reordered from database export)
- align them with the numbers in first column, fill in empty lines for numbers that are not present
-
export into CSV again (see sample file export-2018-09-26-ordered-with-gaps.csv)
- now, you can compare old and new csv with your favourite compare tool (Meld, WinDiff) and see it nicely aligned, see the differences that happened.
You may have to modify files to match some general differences (for example http to image changed to https, and such), (as example see sql-2017-03-26.csv and sql-2017-03-26-ordered-with-gaps-look-like-new.csv)