{"id":20462149,"url":"https://github.com/cstorm125/hosmap","last_synced_at":"2026-07-01T04:32:35.332Z","repository":{"id":104621779,"uuid":"143862994","full_name":"cstorm125/hosmap","owner":"cstorm125","description":"Nearest Hospital Contour Map based on Time Traveled for Thailand","archived":false,"fork":false,"pushed_at":"2019-05-14T03:46:17.000Z","size":61813,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-06T05:04:16.646Z","etag":null,"topics":["data-science","gis","opendata","openstreetmap"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cstorm125.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-08-07T11:21:18.000Z","updated_at":"2019-05-14T03:46:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"8f3d2cdb-3d87-40dd-830c-fd7889f2254f","html_url":"https://github.com/cstorm125/hosmap","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":"0.33333333333333337","last_synced_commit":"e6d4d767077201f55fa1dc5f9e1109df602ee97a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cstorm125/hosmap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cstorm125%2Fhosmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cstorm125%2Fhosmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cstorm125%2Fhosmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cstorm125%2Fhosmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cstorm125","download_url":"https://codeload.github.com/cstorm125/hosmap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cstorm125%2Fhosmap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34993435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-science","gis","opendata","openstreetmap"],"created_at":"2024-11-15T12:30:13.308Z","updated_at":"2026-07-01T04:32:35.311Z","avatar_url":"https://github.com/cstorm125.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hosmap\nNearest Hospital Contour Map based on Time Traveled for Thailand\n\n## Getting Started\n\nHave you ever wondered if you had a stroke in the middle of the night, would you be able to get to the hospital in time? Wonder no more. [hosmap](https://api.mapbox.com/styles/v1/pnphannisa/cjn1335a14z3g2rsehvs818j3.html?fresh=true\u0026title=true\u0026access_token=pk.eyJ1IjoicG5waGFubmlzYSIsImEiOiJjaXVvamFoeTcwMWhjMnRtMWRmeXczZG4yIn0.LjKO5l7YlXgRApgB-jssUg#9/13.8475/100.6639) is a nearest hospital contour map based on time traveled by car for all of Thailand.\n\nSee full report at our [Medium](https://medium.com/@iwishcognitivedissonance/this-map-shows-if-you-will-get-to-the-hospital-in-time-from-anywhere-in-thailand-fd73d13aa3db).\n\n## Mapping Procedures\n\n1. Retrieve hospital physical addresses from 26,881 hospitals listed by [Ministry of Public Health](http://203.157.10.8/hcode_2014/p_export.php?p=3), downloaded as `hospital_addresses.csv`.\n2. Augment the data with latitude and longitude using [Google Map API](https://cloud.google.com/maps-platform/), resulting in `hospital_latlon.csv`. Scraping script can be found at `scripts/scrape_geocode.py`. More detailed data manipulations can be found in `notebooks/codebook.html`\n3. Use ArcGIS to cast 1X1 km fishnets as proxies of all locations in Thailand\n```\nData Management Toolbox \u003e Sampling Toolset \u003e Create Fishnet\nCell Width: 1,000 m\nCell Height: 1,000 m\nThe output is a vector location fishnet.\n```\n4. Use ArcGIS to find the shortest Euclidean distance between all points to their respective nearest hospitals. This is not ideal since nearest hospitals could be different from nearest Euclidean hospitals in some edge cases but it is a necessary step to save computational power.\n```\nAnalysis toolbox \u003e Proximity toolset \u003e Near\nIn_cover: location fishnet\nNear_cover: locations of hospitals\nFeature_type: POINT\nSearch radius: 200 km (to limit number of calculation)\nLocation: LOCATION (to return geographic coordinates of the shortest location)\nThe output is a vector location fishnet with a NEAR column which indicates the shortest Euclidean distance in meters, and latitude and longitude of the nearest hospital.\n```\n5. Use [Graphhopper API](https://graphhopper.com/api/1/docs/routing/) to calculate travel distance and travel time by car from any point to its nearest hospital (about 500,000 points) and saved file as `route_hos_all.csv`. See `scripts/graphhopper_api.py` for more details.\n6. Use ArcGIS to plot travel time fishnet and create a Digital Elevation Model (DEM) of 'travel time by car to the nearest hospital' layer.\n```\n3D Analyst Toolbox \u003e Raster Interpolation Toolset \u003e Topo to Raster\nInput layer: location fishnet layer with data of shortest travel distance and time\nField: Travel ime\nType: POINTELEVATION\nCell size: 1 km, 1 km\nThe output is a raster DEM layer of the of 'travel time by car to the nearest hospital'.\n```\n7. Use ArcGIS to convert raster DEM -\u003e vector polyline layer of 'travel time by car to the nearest hospital' of 10-minute interval between each contour line.\n```\n3D Analyst Toolbox \u003e Raster Surface Toolset \u003e Contour\nIn_raster: travel time DEM layer\nContour interval: 10 minutes\nContour type: CONTOUR\nThe output is a vector polyline layer with a CONTOUR column which indicates the travel time by car to the nearest hospital of each lines.\n```\n8. Visualize 'travel time by car to the nearest hospital' (polyline) and locations of hospitals by [Mapbox](https://www.mapbox.com/).\n```\nTemplate: light\nUploaded additional layers: hospital locations (points), and travel time contour (polylines)\nHospital locations: visualized by hospital icon, size adjusted for each zoom level\nTravel time contour: visualized by graduated color of travel time, 9 classes (0, 10, 20, 30, 40, 60, 90, 140, and greater minutes), line thickness adjusted for each zoom level\nTravel time label (showing travel time in text in addition to the contour): duplicated from travel time contour, font size adjusted for each zoom level\n```\n\n## ตัวแปรที่น่าสนใจเพื่อ Thailand ICT Camp 2019\n\n```\nyear.year\n[1] 2008 2009 2010 2011 2012 2013 2014 2015\n\n$time.time\n [1] \"12011300 \" \"21012200 \" \"16011700 \" \"14011500 \" \"13011400 \" \"15011600 \"\n [7] \"24010100 \" \"22012300 \" \"02010300 \" \"08010900 \" \"23012400 \" \"09011000 \"\n[13] \"\"          \"05010600 \" \"01010200 \" \"11011200 \" \"20012100 \" \"10011100 \"\n[19] \"07010800 \" \"19012000 \" \"06010700 \" \"18011900 \" \"04010500 \" \"17011800 \"\n[25] \"03010400 \"\n\n$belt.belt\n[1] \"เข็มขัด\"  \"ใส่หมวก\" \"ไม่ใส่\"  \n\n$drinking.drinking\n[1] \"ไม่ดื่ม\" \"ดื่ม\"  \n\n$sex.sex\n[1] \"หญิง\" \"ชาย\"\n\n$location.location\n[1] \"ในเมือง\"  \"ทางหลวง\" \"ไม่ทราบ\"  \"ชนบท\"   \n\n$patient_status.patient_status\n[1] \"ผู้ชับขี่\"     \"ผู้โดยสาร\"  \"คนเดินเท้า\" \"ไม่ทราบ\"  \n\n$vehicle_1.vehicle_1\n [1] \"รถเก๋ง/แท็กซี่\"    \"จักรยานยนต์\"     \"อื่นๆ\"           \"ไม่ทราบ\"        \"รถจักรยาน\"     \n [6] \"สามล้อถีบ\"       \"ไม่มี/ล้มเอง\"     \"สามล้อเครื่อง\"    \"ปิคอัพ\"          \"รถโดยสารใหญ่\"  \n[11] \"รถตู้\"           \"รถโดยสาร 4 ล้อ\" \"รถบรรทุก\"      \n\n$vehicle_2.vehicle_2\n [1] \"ไม่มี/ล้มเอง\"     \"รถตู้\"           \"จักรยานยนต์\"     \"ปิคอัพ\"          \"รถเก๋ง/แท็กซี่\"   \n [6] \"สามล้อถีบ\"       \"รถจักรยาน\"      \"ไม่ทราบ\"        \"รถโดยสาร 4 ล้อ\" \"สามล้อเครื่อง\"   \n[11] \"รถโดยสารใหญ่\"   \"อื่นๆ\"           \"รถบรรทุก\"      \n\n$age.age\n [1] 54 13 59 41 42 26 21 31 28 22 20 39 58 44 33 30 32 17 23 18 19 36  3  2 38 34 64\n[28] 88 50 27  6 40 43 45 48 47 25 24 16 35  9 10 12 29 46 56 61 15 14 60 51 52 62 87\n[55] 55  4  5 57 70 37 49 11  7  1 53 71  8 78 63 66 67 68 65 69 84 98 74 73 72 77 85\n[82] 82 83 79 76 75 92 81 96 80 93 86 89 90 97 91 94 95\n\n$reporter.reporter\n[1] \"ผู้ประสบเหตุ/ญาติ\" \"มูลนิธิ/อาสาสมัคร\" \"เจ้าหน้าที่ตำรวจ\"  \"ไม่นำส่ง\"        \"BLS\"          \n[6] \"ALS\"           \"FR\"            \"เสียชีวิตที่เกิดเหตุ\" \"ILS\"          \n\n$province.province\n [1] \"กรุงเทพมหานคร\"  \"สมุทรปราการ\"    \"นนทบุรี\"         \"ปทุมธานี\"        \"พระนครศรีอยุธยา\"\n [6] \"อ่างทอง\"        \"ลพบุรี\"          \"สิงห์บุรี\"         \"ชัยนาท\"         \"สระบุรี\"        \n[11] \"ชลบุรี\"          \"ระยอง\"         \"จันทบุรี\"         \"ตราด\"          \"ฉะเชิงเทรา\"    \n[16] \"ปราจีนบุรี\"       \"นครนายก\"       \"สระแก้ว\"        \"นครราชสีมา\"     \"บุรีรัมย์\"        \n[21] \"สุรินทร์\"         \"ศรีสะเกษ\"       \"อุบลราชธานี\"     \"ยโสธร\"         \"ชัยภูมิ\"         \n[26] \"อำนาจเจริญ\"     \"หนองบัวลำภู\"     \"ขอนแก่น\"        \"อุดรธานี\"        \"เลย\"          \n[31] \"หนองคาย\"       \"มหาสารคาม\"     \"ร้อยเอ็ด\"        \"กาฬสินธุ์\"        \"สกลนคร\"       \n[36] \"นครพนม\"        \"มุกดาหาร\"       \"เชียงใหม่\"       \"ลำพูน\"          \"ลำปาง\"        \n[41] \"อุตรดิตถ์\"        \"แพร่\"           \"น่าน\"           \"พะเยา\"         \"เชียงราย\"      \n[46] \"แม่ฮ่องสอน\"      \"นครสวรรค์\"      \"อุทัยธานี\"        \"กำแพงเพชร\"     \"ตาก\"          \n[51] \"สุโขทัย\"         \"พิษณุโลก\"        \"พิจิตร\"          \"เพชรบูรณ์\"       \"ราชบุรี\"        \n[56] \"กาญจนบุรี\"       \"สุพรรณบุรี\"       \"นครปฐม\"        \"สมุทรสาคร\"      \"สมุทรสงคราม\"   \n[61] \"เพชรบุรี\"        \"ประจวบคีรีขันธ์\"   \"นครศรีธรรมราช\"  \"กระบี่\"          \"พังงา\"         \n[66] \"ภูเก็ต\"          \"สุราษฎร์ธานี\"     \"ระนอง\"         \"ชุมพร\"          \"สงขลา\"        \n[71] \"สตูล\"           \"ตรัง\"           \"พัทลุง\"          \"ปัตตานี\"         \"ยะลา\"         \n[76] \"นราธิวาส\"       \"บึงกาฬ\"        \n\n$referral_flag.referral_flag\n[1] \"ไม่\"            \"admit\"         \"ส่งต่อก่อน admit\" \"ส่งต่อหลัง admit\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcstorm125%2Fhosmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcstorm125%2Fhosmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcstorm125%2Fhosmap/lists"}