-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
36,708 additions
and
0 deletions.
There are no files selected for viewing
118 changes: 118 additions & 0 deletions
118
...db/proprecessing/disability_facilities/.ipynb_checkpoints/extract_latlon-checkpoint.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "8349c3c3", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import pandas as pd\n", | ||
"import os\n", | ||
"import json\n", | ||
"from time import sleep\n", | ||
"import requests\n", | ||
"import googlemaps" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "dd65a263", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from urllib.parse import quote\n", | ||
"from urllib.request import Request, urlopen\n", | ||
"import ssl\n", | ||
"import json" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "c67b8c21", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"API_KEY = \"********\"\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"id": "624a943f", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"100%|████████████████████████████████████████████████████████████████████████████████| 149/149 [00:17<00:00, 8.42it/s]\n", | ||
"100%|██████████████████████████████████████████████████████████████████████████████████| 26/26 [00:04<00:00, 6.50it/s]\n", | ||
"100%|██████████████████████████████████████████████████████████████████████████████████| 52/52 [00:08<00:00, 6.18it/s]\n", | ||
"100%|████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:00<00:00, 6.64it/s]\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"from tqdm import tqdm\n", | ||
"\n", | ||
"maps = googlemaps.Client(key=API_KEY)\n", | ||
"\n", | ||
"lst = ['공동생활가정_경기도', '단기거주시설_경기도', '중증장애인거주시설_경기도', '지체장애인시설_경기도']\n", | ||
"for fname in lst:\n", | ||
" try:\n", | ||
" df = pd.read_csv(f'{fname}.csv')\n", | ||
" except:\n", | ||
" df = pd.read_csv(f'{fname}.csv', encoding='cp949')\n", | ||
" \n", | ||
" lat, lon = [], []\n", | ||
"\n", | ||
" for address in tqdm(df['시설주소']):\n", | ||
" try:\n", | ||
" geo_location = maps.geocode(address)[0].get('geometry')\n", | ||
" lat.append(geo_location['location']['lat'])\n", | ||
" lon.append(geo_location['location']['lng']) \n", | ||
" except:\n", | ||
" lat.append('')\n", | ||
" lon.append('')\n", | ||
" print(f\"{address} 에러\")\n", | ||
"\n", | ||
" df['lat'] = lat\n", | ||
" df['lon'] = lon\n", | ||
"\n", | ||
" df.to_csv(f'{fname}_위경도.csv', index=False)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b4c1fdd5", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Binary file added
BIN
+79 KB
src/db/proprecessing/disability_facilities/2023년_장애인_복지시설_일람표(2022.12월말_기준) (1).docx
Binary file not shown.
Binary file added
BIN
+3.16 MB
src/db/proprecessing/disability_facilities/2023년_장애인_복지시설_일람표(2022.12월말_기준) (1).pdf
Binary file not shown.
Binary file not shown.
118 changes: 118 additions & 0 deletions
118
src/db/proprecessing/disability_facilities/extract_latlon.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "8349c3c3", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import pandas as pd\n", | ||
"import os\n", | ||
"import json\n", | ||
"from time import sleep\n", | ||
"import requests\n", | ||
"import googlemaps" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "dd65a263", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from urllib.parse import quote\n", | ||
"from urllib.request import Request, urlopen\n", | ||
"import ssl\n", | ||
"import json" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "c67b8c21", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"API_KEY = \"********\"\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"id": "624a943f", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"100%|████████████████████████████████████████████████████████████████████████████████| 149/149 [00:17<00:00, 8.42it/s]\n", | ||
"100%|██████████████████████████████████████████████████████████████████████████████████| 26/26 [00:04<00:00, 6.50it/s]\n", | ||
"100%|██████████████████████████████████████████████████████████████████████████████████| 52/52 [00:08<00:00, 6.18it/s]\n", | ||
"100%|████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:00<00:00, 6.64it/s]\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"from tqdm import tqdm\n", | ||
"\n", | ||
"maps = googlemaps.Client(key=API_KEY)\n", | ||
"\n", | ||
"lst = ['공동생활가정_경기도', '단기거주시설_경기도', '중증장애인거주시설_경기도', '지체장애인시설_경기도']\n", | ||
"for fname in lst:\n", | ||
" try:\n", | ||
" df = pd.read_csv(f'{fname}.csv')\n", | ||
" except:\n", | ||
" df = pd.read_csv(f'{fname}.csv', encoding='cp949')\n", | ||
" \n", | ||
" lat, lon = [], []\n", | ||
"\n", | ||
" for address in tqdm(df['시설주소']):\n", | ||
" try:\n", | ||
" geo_location = maps.geocode(address)[0].get('geometry')\n", | ||
" lat.append(geo_location['location']['lat'])\n", | ||
" lon.append(geo_location['location']['lng']) \n", | ||
" except:\n", | ||
" lat.append('')\n", | ||
" lon.append('')\n", | ||
" print(f\"{address} 에러\")\n", | ||
"\n", | ||
" df['lat'] = lat\n", | ||
" df['lon'] = lon\n", | ||
"\n", | ||
" df.to_csv(f'{fname}_위경도.csv', index=False)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b4c1fdd5", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.