{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"### Make kml file code","metadata":{}},{"cell_type":"code","source":"!pip install simplekml","metadata":{"execution":{"iopub.status.busy":"2022-03-30T11:32:36.837721Z","iopub.execute_input":"2022-03-30T11:32:36.838260Z","iopub.status.idle":"2022-03-30T11:32:48.142607Z","shell.execute_reply.started":"2022-03-30T11:32:36.838144Z","shell.execute_reply":"2022-03-30T11:32:48.141521Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import simplekml\nimport pandas as pd","metadata":{"execution":{"iopub.status.busy":"2022-03-30T11:32:48.144529Z","iopub.execute_input":"2022-03-30T11:32:48.144922Z","iopub.status.idle":"2022-03-30T11:32:48.164570Z","shell.execute_reply.started":"2022-03-30T11:32:48.144880Z","shell.execute_reply":"2022-03-30T11:32:48.163570Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df1 = pd.read_csv(\"../input/google-smartphone-decimeter-challenge/baseline_locations_test.csv\")\ndf = pd.read_csv(\"../input/delete-now/submission_gscd.csv\")","metadata":{"execution":{"iopub.status.busy":"2022-03-30T11:36:58.470588Z","iopub.execute_input":"2022-03-30T11:36:58.471007Z","iopub.status.idle":"2022-03-30T11:36:58.831633Z","shell.execute_reply.started":"2022-03-30T11:36:58.470972Z","shell.execute_reply":"2022-03-30T11:36:58.830238Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df['phone'] = df1['phone']","metadata":{"execution":{"iopub.status.busy":"2022-03-30T11:36:59.041197Z","iopub.execute_input":"2022-03-30T11:36:59.041582Z","iopub.status.idle":"2022-03-30T11:36:59.048638Z","shell.execute_reply.started":"2022-03-30T11:36:59.041550Z","shell.execute_reply":"2022-03-30T11:36:59.047492Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"names = df[\"phone\"].unique()\nlen(df[\"phone\"].unique())","metadata":{"execution":{"iopub.status.busy":"2022-03-30T11:36:59.621390Z","iopub.execute_input":"2022-03-30T11:36:59.621911Z","iopub.status.idle":"2022-03-30T11:36:59.651357Z","shell.execute_reply.started":"2022-03-30T11:36:59.621876Z","shell.execute_reply":"2022-03-30T11:36:59.649956Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"kml = simplekml.Kml(open=1)\nfor name_ in names:\n    temp  = df[df[\"phone\"] == name_]\n    temp_ = []\n    for ele in temp[[\"lngDeg\",\"latDeg\"]].values.tolist():\n        temp_.append(tuple(ele))\n    linestring = kml.newlinestring(name = name_)\n    linestring.style.linestyle.width = 30\n#     linestring.style.linestyle.color = simplekml.Color.azure\n    linestring.coords = temp_\nkml.savekmz('test.kmz')","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-03-30T11:37:00.927423Z","iopub.execute_input":"2022-03-30T11:37:00.927929Z","iopub.status.idle":"2022-03-30T11:37:02.340898Z","shell.execute_reply.started":"2022-03-30T11:37:00.927896Z","shell.execute_reply":"2022-03-30T11:37:02.339694Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}