-
Notifications
You must be signed in to change notification settings - Fork 0
/
clustering.html
239 lines (219 loc) · 5.63 KB
/
clustering.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Dengue Hotspot Predictor</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<!-- Leaflet Js -->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
crossorigin=""/>
<!-- Make sure you put this AFTER Leaflet's CSS -->
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og=="
crossorigin=""></script>
<!-- GEO JSON -->
<script>
var geojsonFeature = {
"type": "Feature",
"properties": {
"name": "Coors Field",
"amenity": "Baseball Stadium",
"popupContent": "This is where the Rockies play!"
},
"geometry": {
"type": "Point",
"coordinates": [-104.99404, 39.75621]
}
};
</script>
<style>
#mapid { height: 800px; }
</style>
</head>
<body>
<div class="col-md-12"><h1>Clustering of dengue cases and nearby hospitals</h1></div>
<div>
<div id="mapid"></div>
</div>
</body>
<!-- for geo map -->
<script>
const mymap = L.map('mapid').setView([23.8103, 90.4125], 11 );
L.tileLayer(
'https://api.mapbox.com/styles/v1/mapbox/emerald-v8/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoiYWJyYXJzaGFyaWFyIiwiYSI6ImNrMXZyMGhnazA0aGEzaG0wMGU1YmVjZnkifQ.jhvdryFYh4_8rLHkX2o5KQ', {
tileSize: 512,
zoomOffset: -1,
attribution: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(mymap);
// dengue red spots
const latLongDengue = [{
"lat": 23.8113,
"lng": 90.4325
}, {
"lat": 23.8122,
"lng": 90.4254
}, {
"lat": 23.8131,
"lng": 90.3180
},
{
"lat": 23.7131,
"lng": 90.1180
},
{
"lat": 23.7131,
"lng": 90.9180
},
{
"lat": 23.8131,
"lng": 90.4180
},
{
"lat": 23.8931,
"lng": 90.4980
},
{
"lat": 23.8191,
"lng": 90.4380
},
{
"lat": 23.8121,
"lng": 90.4360
},
{
"lat": 23.8129,
"lng": 90.4367
},
{
"lat": 23.8121,
"lng": 90.4361
},
{
"lat": 23.8191,
"lng": 90.4311
},
{
"lat": 23.8101,
"lng": 90.4301
},
{
"lat": 23.8100,
"lng": 90.4300
},
{
"lat": 23.8100,
"lng": 90.4100
},
{
"lat": 23.4590,
"lng": 90.2294
}, {
"lat": 23.4842,
"lng": 90.2345
}, {
"lat": 23.4826,
"lng": 90.2467
},
{
"lat": 23.4895,
"lng": 90.2591
},
{
"lat": 23.4490,
"lng": 90.2150
}, {
"lat": 23.4792,
"lng": 90.2295
}, {
"lat": 23.4776,
"lng": 90.2377
},
{
"lat": 23.4715,
"lng": 90.2411
}
];
latLongDengue.forEach(function(coord) {
var circle = L.circle(coord, {
color: 'red',
fillColor: '#f03',
fillOpacity: 0.5,
radius: Math.random() * 1000
}).addTo(mymap);
});
// square hospital:
// longitude: 23 degrees 45 minutes 10 seconds
// latitude: 90 degrees 22 minutes 54 seconds
//
// CMH hospital:
// longitude: 23 degrees 48 minutes 52 seconds
// latitude: 90 degrees 23 minutes 55 seconds
//
// united hospital:
// longitude: 23 degrees 48 minutes 16 seconds
// latitude: 90 degrees 24 minutes 57 seconds
//
// Apollo hospital:
// longitude: 23 degrees 48 minutes 35 seconds
// latitude: 90 degrees 25 minutes 51 seconds
//
// Labaid specialized hospital:
// longitude: 23 degrees 44 minutes 31 seconds
// latitude: 90 degrees 22 minutes 59 seconds
const latLongHospital = [
{
"name": "square hospital",
"lat": 23.8100,
"lng": 90.4300,
"capacity": 1000,
"patients": 900
},
{
"name": "DMC hospital",
"lat": 23.8000,
"lng": 90.4100,
"capacity": 1200,
"patients": 500
}, {
"name": "united hospital",
"lat": 23.8200,
"lng": 90.3180,
"capacity": 1000,
"patients": 900
},
{
"name": "Apollo hospital",
"lat": 23.4510,
"lng": 90.2254,
"capacity": 1500,
"patients": 700
}, {
"name": "labaid hospital",
"lat": 23.4852,
"lng": 90.2355,
"capacity": 5000,
"patients": 900
}, {
"name": "uttara hospital",
"lat": 23.4816,
"lng": 90.2457,
"capacity": 2000,
"patients": 198
},
{
"name": "poribaag hospital",
"lat": 23.4835,
"lng": 90.2551,
"capacity": 5000,
"patients": 1700
}
]
//
latLongHospital.forEach(function (hos) {
let marker = L.marker(hos).addTo(mymap);
marker.bindPopup(`<b>${hos.name} </b><br>Capacity: ${hos.capacity}<br>Patients: ${hos.patients}`).openPopup();
})
</script>
</script>
</html>