-
Notifications
You must be signed in to change notification settings - Fork 7
/
drought_maps.html
814 lines (790 loc) · 47.5 KB
/
drought_maps.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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Drought Maps | Visualising Water Data</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Visualising Water Data for India Water Portal">
<meta name="author" content="ajantriks">
<!-- Google Web Fonts -->
<link href='http://fonts.googleapis.com/css?family=Bitter|Open+Sans' rel='stylesheet' type='text/css'>
<!-- Bootstrap CSS -->
<link href="lib/bootstrap/css/bootstrap.css" rel="stylesheet">
<style>
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
}
</style>
<link href="lib/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<!-- Lightbox -->
<script src="lib/lightbox/js/jquery-1.7.2.min.js"></script>
<script src="lib/lightbox/js/lightbox.js"></script>
<link href="lib/lightbox/css/lightbox.css" rel="stylesheet" />
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="lib/bootstrap/js/html5shiv.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="../assets/ico/favicon.png">
<!-- Highlight.js -->
<link rel="stylesheet" href="lib/highlight.js/styles/github.css">
<script src="lib/highlight.js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="brand">Visualising Water Data</div>
<div class="nav-collapse collapse">
<ul class="nav">
<li class=""><a href="index.html">Home</a></li>
<li class="dropdown active">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Visualisations <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="drought_maps.html">Drought Maps</a></li>
<li><a href="ground_water.html">Ground Water Charts</a></li>
<li><a href="kausani_rainfall.html">Kausani Rainfall Charts</a></li>
<li><a href="rainfall_ground_water_motion_charts.html">Rainfall and Ground Water Motion Charts</a></li>
<li><a href="rainfall_maps.html">Rainfall Maps</a></li>
</ul>
</li>
</ul>
</div>
<div class="navbar-inner pull-right">
<ul class="nav">
<li><a href="http://indiawaterportal.org/" target="_blank">India Water Portal</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container">
<h3>Drought Maps</h3>
<p>Maps showing incidence of drought across districts of India, from 1905 to 1997. A district has been considered as experiencing drought if the annual rainfall for the district for the year is found to be less than 75% of the ten year moving average annual rainfall for the district for the year. The rainfall data is sourced from <a href="http://www.indiawaterportal.org/articles/meteorological-datasets-download-entire-datasets-various-meteorological-indicators-1901" target="_blank">India Meteorological Department</a> (IMD), the Indian district boundaries are sourced from the <a href="http://gadm.org/" target="_blank">GADM database</a>, and the national boundary of India is extracted from the <a href="http://www.censusindia.gov.in/2011census/maps/administrative_maps/INDIA2011.pdf" target="_blank">administrative divisions map of Census of India 2011</a>.</p>
<br />
<h4>Maps:</h4>
<p><strong>How to use:</strong> Click on thumbnails to see full-size maps. Hit *Escape* to exit the lightbox.</p>
<p><strong>Legends:</strong> These are <a href="https://en.wikipedia.org/wiki/Choropleth" target="_blank">choropleth maps</a>. A district is shaded in *red* if it is suffering from drought, and shaded in *light gray* otherwise.</p>
<p><strong>Note on rainfall data:</strong> The rainfall data available from IMD does not provide measurements for several districts, such as Ashoknagar, Annupur and Burhanpur in Madhya Pradesh, and Bongaigaon and Marigaon in Assam. In the maps, these districts can be found as areas within the national boundary shaded in *white* (indicating absent data). Details of the districts with absent data can be found in the file containing the <a href="https://github.com/ajantriks/iwp/blob/master/R_code/drought_maps.R" target="_blank">R code for generating these maps</a>.</p>
<p><strong>Note on administrative boundaries data:</strong> Please note that district and national boundary data available from <a href="http://gadm.org/" target="_blank">GADM</a> and extracted from <a href="http://www.censusindia.gov.in/2011census/maps/administrative_maps/INDIA2011.pdf" target="_blank">administrative divisions map of Census of India 2011</a> may not accurately represent the official national boundary of the country, and may neither include the most recent list of districts.</p>
<br />
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1905_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1905"><img src="images/drought_maps/imd_drought_1905_web_small.png">
<h8>1905</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1906_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1906"><img src="images/drought_maps/imd_drought_1906_web_small.png">
<h8>1906</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1907_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1907"><img src="images/drought_maps/imd_drought_1907_web_small.png">
<h8>1907</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1908_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1908"><img src="images/drought_maps/imd_drought_1908_web_small.png">
<h8>1908</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1909_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1909"><img src="images/drought_maps/imd_drought_1909_web_small.png">
<h8>1909</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1910_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1910"><img src="images/drought_maps/imd_drought_1910_web_small.png">
<h8>1910</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1911_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1911"><img src="images/drought_maps/imd_drought_1911_web_small.png">
<h8>1911</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1912_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1912"><img src="images/drought_maps/imd_drought_1912_web_small.png">
<h8>1912</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1913_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1913"><img src="images/drought_maps/imd_drought_1913_web_small.png">
<h8>1913</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1914_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1914"><img src="images/drought_maps/imd_drought_1914_web_small.png">
<h8>1914</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1915_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1915"><img src="images/drought_maps/imd_drought_1915_web_small.png">
<h8>1915</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1916_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1916"><img src="images/drought_maps/imd_drought_1916_web_small.png">
<h8>1916</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1917_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1917"><img src="images/drought_maps/imd_drought_1917_web_small.png">
<h8>1917</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1918_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1918"><img src="images/drought_maps/imd_drought_1918_web_small.png">
<h8>1918</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1919_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1919"><img src="images/drought_maps/imd_drought_1919_web_small.png">
<h8>1919</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1920_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1920"><img src="images/drought_maps/imd_drought_1920_web_small.png">
<h8>1920</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1921_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1921"><img src="images/drought_maps/imd_drought_1921_web_small.png">
<h8>1921</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1922_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1922"><img src="images/drought_maps/imd_drought_1922_web_small.png">
<h8>1922</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1923_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1923"><img src="images/drought_maps/imd_drought_1923_web_small.png">
<h8>1923</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1924_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1924"><img src="images/drought_maps/imd_drought_1924_web_small.png">
<h8>1924</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1925_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1925"><img src="images/drought_maps/imd_drought_1925_web_small.png">
<h8>1925</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1926_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1926"><img src="images/drought_maps/imd_drought_1926_web_small.png">
<h8>1926</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1927_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1927"><img src="images/drought_maps/imd_drought_1927_web_small.png">
<h8>1927</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1928_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1928"><img src="images/drought_maps/imd_drought_1928_web_small.png">
<h8>1928</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1929_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1929"><img src="images/drought_maps/imd_drought_1929_web_small.png">
<h8>1929</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1930_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1930"><img src="images/drought_maps/imd_drought_1930_web_small.png">
<h8>1930</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1931_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1931"><img src="images/drought_maps/imd_drought_1931_web_small.png">
<h8>1931</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1932_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1932"><img src="images/drought_maps/imd_drought_1932_web_small.png">
<h8>1932</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1933_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1933"><img src="images/drought_maps/imd_drought_1933_web_small.png">
<h8>1933</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1934_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1934"><img src="images/drought_maps/imd_drought_1934_web_small.png">
<h8>1934</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1935_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1935"><img src="images/drought_maps/imd_drought_1935_web_small.png">
<h8>1935</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1936_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1936"><img src="images/drought_maps/imd_drought_1936_web_small.png">
<h8>1936</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1937_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1937"><img src="images/drought_maps/imd_drought_1937_web_small.png">
<h8>1937</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1938_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1938"><img src="images/drought_maps/imd_drought_1938_web_small.png">
<h8>1938</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1939_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1939"><img src="images/drought_maps/imd_drought_1939_web_small.png">
<h8>1939</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1940_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1940"><img src="images/drought_maps/imd_drought_1940_web_small.png">
<h8>1940</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1941_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1941"><img src="images/drought_maps/imd_drought_1941_web_small.png">
<h8>1941</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1942_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1942"><img src="images/drought_maps/imd_drought_1942_web_small.png">
<h8>1942</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1943_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1943"><img src="images/drought_maps/imd_drought_1943_web_small.png">
<h8>1943</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1944_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1944"><img src="images/drought_maps/imd_drought_1944_web_small.png">
<h8>1944</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1945_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1945"><img src="images/drought_maps/imd_drought_1945_web_small.png">
<h8>1945</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1946_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1946"><img src="images/drought_maps/imd_drought_1946_web_small.png">
<h8>1946</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1947_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1947"><img src="images/drought_maps/imd_drought_1947_web_small.png">
<h8>1947</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1948_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1948"><img src="images/drought_maps/imd_drought_1948_web_small.png">
<h8>1948</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1949_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1949"><img src="images/drought_maps/imd_drought_1949_web_small.png">
<h8>1949</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1950_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1950"><img src="images/drought_maps/imd_drought_1950_web_small.png">
<h8>1950</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1951_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1951"><img src="images/drought_maps/imd_drought_1951_web_small.png">
<h8>1951</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1952_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1952"><img src="images/drought_maps/imd_drought_1952_web_small.png">
<h8>1952</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1953_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1953"><img src="images/drought_maps/imd_drought_1953_web_small.png">
<h8>1953</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1954_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1954"><img src="images/drought_maps/imd_drought_1954_web_small.png">
<h8>1954</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1955_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1955"><img src="images/drought_maps/imd_drought_1955_web_small.png">
<h8>1955</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1956_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1956"><img src="images/drought_maps/imd_drought_1956_web_small.png">
<h8>1956</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1957_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1957"><img src="images/drought_maps/imd_drought_1957_web_small.png">
<h8>1957</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1958_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1958"><img src="images/drought_maps/imd_drought_1958_web_small.png">
<h8>1958</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1959_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1959"><img src="images/drought_maps/imd_drought_1959_web_small.png">
<h8>1959</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1960_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1960"><img src="images/drought_maps/imd_drought_1960_web_small.png">
<h8>1960</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1961_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1961"><img src="images/drought_maps/imd_drought_1961_web_small.png">
<h8>1961</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1962_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1962"><img src="images/drought_maps/imd_drought_1962_web_small.png">
<h8>1962</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1963_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1963"><img src="images/drought_maps/imd_drought_1963_web_small.png">
<h8>1963</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1964_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1964"><img src="images/drought_maps/imd_drought_1964_web_small.png">
<h8>1964</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1965_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1965"><img src="images/drought_maps/imd_drought_1965_web_small.png">
<h8>1965</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1966_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1966"><img src="images/drought_maps/imd_drought_1966_web_small.png">
<h8>1966</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1967_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1967"><img src="images/drought_maps/imd_drought_1967_web_small.png">
<h8>1967</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1968_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1968"><img src="images/drought_maps/imd_drought_1968_web_small.png">
<h8>1968</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1969_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1969"><img src="images/drought_maps/imd_drought_1969_web_small.png">
<h8>1969</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1970_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1970"><img src="images/drought_maps/imd_drought_1970_web_small.png">
<h8>1970</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1971_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1971"><img src="images/drought_maps/imd_drought_1971_web.png">
<h8>1971</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1972_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1972"><img src="images/drought_maps/imd_drought_1972_web_small.png">
<h8>1972</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1973_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1973"><img src="images/drought_maps/imd_drought_1973_web_small.png">
<h8>1973</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1974_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1974"><img src="images/drought_maps/imd_drought_1974_web_small.png">
<h8>1974</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1975_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1975"><img src="images/drought_maps/imd_drought_1975_web_small.png">
<h8>1975</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1976_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1976"><img src="images/drought_maps/imd_drought_1976_web_small.png">
<h8>1976</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1977_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1977"><img src="images/drought_maps/imd_drought_1977_web_small.png">
<h8>1977</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1978_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1978"><img src="images/drought_maps/imd_drought_1978_web_small.png">
<h8>1978</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1979_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1979"><img src="images/drought_maps/imd_drought_1979_web_small.png">
<h8>1979</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1980_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1980"><img src="images/drought_maps/imd_drought_1980_web_small.png">
<h8>1980</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1981_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1981"><img src="images/drought_maps/imd_drought_1981_web_small.png">
<h8>1981</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1982_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1982"><img src="images/drought_maps/imd_drought_1982_web_small.png">
<h8>1982</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1983_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1983"><img src="images/drought_maps/imd_drought_1983_web_small.png">
<h8>1983</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1984_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1984"><img src="images/drought_maps/imd_drought_1984_web_small.png">
<h8>1984</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1985_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1985"><img src="images/drought_maps/imd_drought_1985_web_small.png">
<h8>1985</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1986_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1986"><img src="images/drought_maps/imd_drought_1986_web_small.png">
<h8>1986</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1987_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1987"><img src="images/drought_maps/imd_drought_1987_web_small.png">
<h8>1987</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1988_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1988"><img src="images/drought_maps/imd_drought_1988_web_small.png">
<h8>1988</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1989_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1989"><img src="images/drought_maps/imd_drought_1989_web_small.png">
<h8>1989</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1990_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1990"><img src="images/drought_maps/imd_drought_1990_web_small.png">
<h8>1990</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1991_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1991"><img src="images/drought_maps/imd_drought_1991_web_small.png">
<h8>1991</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1992_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1992"><img src="images/drought_maps/imd_drought_1992_web_small.png">
<h8>1992</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1993_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1993"><img src="images/drought_maps/imd_drought_1993_web_small.png">
<h8>1993</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1994_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1994"><img src="images/drought_maps/imd_drought_1994_web_small.png">
<h8>1994</h8>
</a></div>
</li>
</ul>
<ul class="thumbnails">
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1995_web.png" rel="lightbox[gw]" title="Incidents of Drought across Districts, India, 1995"><img src="images/drought_maps/imd_drought_1995_web_small.png">
<h8>1995</h8>
</a></div>
</li>
<li class="span2">
<div class="thumbnail">
<a href="images/drought_maps/imd_drought_1996_web.png" rel="lightbox[rm]" title="Incidents of Drought across Districts, India, 1996"><img src="images/drought_maps/imd_drought_1996_web_small.png">
<h8>1996</h8>
</a></div>
</li>
</ul>
<br />
<h4>Documentation:</h4>
<br />
<p>The original IMD rainfall data for 1901-2002 comes in three MS Excel spreadsheets, and each of them contains data for a set of states (for the entire period). The data is organised as follows (with the state and district codes given in a separate sheet of the spreadsheet file):</p>
<pre><code>State ID,District ID,Year,January,February,March,April,May,June,July,August,September,October,November,December
1,1,1901,398.24,331.86,563.32,757.26,944.61,802.88,1020.44,432.67,717.18,223.14,44.45,101.16
1,1,1902,255.22,331.97,746.78,962.14,954.47,1116.03,910.09,688.77,542.22,434.55,523.79,159.64
1,1,1903,607.9,589.12,692.71,594.51,830.91,817.7,1094.51,983.38,732.75,165.03,146.73,210.24</pre></code>
<p>To use this data along with the Indian district boundaries datset from <a href="http://gadm.org/" target="_blank">GADM</a>, it needs to be re-organised in the following format, where each row gives the annual (aggregate) rainfall (for the year concerned) for a specific district for a specific year:</p>
<pre><code>"State.ID","District.ID","Year","Annual.Rainfall"
"Jammu and Kashmir","Kupwara (Muzaffarabad)",1901,6337.21
"Jammu and Kashmir","Kupwara (Muzaffarabad)",1902,7625.67
"Jammu and Kashmir","Kupwara (Muzaffarabad)",1903,7465.49</pre></code>
<p>This format is useful because it allows the *District.ID* value of a row to be used to link up the count of annual (aggregate) rainfall for a district (and for a year) to its corresponding district boundary shape (available from the Indian district boundaries data file). To enable this, the name of the districts must match between the rainfall data file and the district boundaries shapefile.</p>
<p>To do this, first IMD rainfall data files are converted from MS Excel spreadsheet format to .csv (Comma Separated Value) format, and read into R using the <code>read.csv</code> command. Then they are combined into a single file ("imd_states_name_1-35.csv") using the <code>rbind</code> command.</p>
<pre><code>d1 <- read.csv("imd_states_1-10.csv")
d2 <- read.csv("imd_states_11-25.csv")
d3 <- read.csv("imd_states_26-35.csv")
data <- rbind(d1,d2,d3)
View(data)
write.csv(data, file="imd_states_name_1-35.csv")</pre></code>
<p>Then the state and district codes from the IMD rainfall data file are converted to their respective names, by following the spellings of those state and district names as given in the GADM district boundaries shapefile. The second line below replace the values of *State.ID* by "Jammu and Kashmir" (spelt as in GADM district boundaries shapefile) if the present value is "1". The third line below replace the values of *District.ID* by "Kupwara (Muzaffarabad)" (spelt as in GADM district boundaries shapefile) if the present value is "1" and the corresponding *District.ID* value is "Jammu and Kashmir".</p>
<pre><code>d <- read.csv ("imd_states_name_1-35.csv")
d$State.ID [d$State.ID == "1"] <- "Jammu and Kashmir"
d$District.ID [d$State.ID == "Jammu and Kashmir" & d$District.ID == "1"] <- "Kupwara (Muzaffarabad)"</code></pre>
<p>Once such replacing of the state and district codes by their corresponding names (spelt as in GADM district boundaries shapefile) is done, the data takes the following form:</p>
<pre><code>"State.ID","District.ID","Year","January","February","March","April","May","June","July","August","September","October","November","December"
"Jammu and Kashmir","Kupwara (Muzaffarabad)",1901,398.24,331.86,563.32,757.26,944.61,802.88,1020.44,432.67,717.18,223.14,44.45,101.16
"Jammu and Kashmir","Kupwara (Muzaffarabad)",1902,255.22,331.97,746.78,962.14,954.47,1116.03,910.09,688.77,542.22,434.55,523.79,159.64
"Jammu and Kashmir","Kupwara (Muzaffarabad)",1903,607.9,589.12,692.71,594.51,830.91,817.7,1094.51,983.38,732.75,165.03,146.73,210.24</pre></code>
<p>Now the present structure of the table, where each row shows monthly rainfall counts for all months for a single year, needs to be changed to a structure where each rows gives the annual (aggregate) rainfall in a district for an unique combination of year and month. This is done using the <code>melt</code> command from the <a href="http://cran.r-project.org/web/packages/reshape2/" target="_blank">Reshape2 package of R</a>, by converting the month columns ("January" to "December") into a single column that takes the months as its values.</p>
<p>Please note that if the data table you are working with has a first column titled 'X', then please delete the column before running the <code>melt</code> command by using this command: <code>d$X <- NULL</code>.
<pre><code>library(reshape2)
dm <- melt(d, id = c('State.ID', 'District.ID', 'Year'))</code></pre>
<p>This converts the data to the following format:</p>
<pre><code>"State.ID","District.ID","Year","variable","value"
"Jammu and Kashmir","Kupwara (Muzaffarabad)",1901,"January",398.24
"Jammu and Kashmir","Kupwara (Muzaffarabad)",1902,"January",255.22
"Jammu and Kashmir","Kupwara (Muzaffarabad)",1903,"January",607.9</pre></code>
<p>But this gives the volume of rainfall for each district for each month (for each year), and not the annual (aggregate) rainfall for each district (for each year) that we need to generate the maps concerned.</p>
<p>The following commands generate this annual (aggregate) rainfall for each district (for each year), by taking the average of *value* for all rows with unique combinations of *State.ID*, *District.ID* and *Year*, and multiplying it by "12".</p>
<pre><code>dm$Avg.Monthly.Rainfall <- with(dm, ave(value, State.ID, District.ID, Year))
dm$Annual.Rainfall <- with(dm, Avg.Monthly.Rainfall * 12)</pre></code>
<p>This converts the data to the following format:</p>
<pre><code>"State.ID","District.ID","Year","variable","value","Avg.Monthly.Rainfall","Annual.Rainfall"
"Jammu and Kashmir","Kupwara (Muzaffarabad)",1901,"January",398.24,528.100833333333,6337.21
"Jammu and Kashmir","Kupwara (Muzaffarabad)",1902,"January",255.22,635.4725,7625.67
"Jammu and Kashmir","Kupwara (Muzaffarabad)",1903,"January",607.9,622.124166666667,7465.49</code></pre>
<p>The reformatted data table is saved.</p>
<pre><code>write.csv(dm, file = "imd_states_name_1-35_annual-rainfall.csv")</code></pre>
<p>The resultant data file still has separate rows for all the months of each year. Since, the annual (aggregate) rainfall for each year have already been generated, there is no need for these rows for separate months. The first line below takes a subset of the data with only rows for the month of "January" (for all years); and the next lines remove the variables that are not needed anymore and save the data table again.</p>
<pre><code>d2 <- subset(dm, dm$variable == "January")
d2$variable <- NULL
d2$value <- NULL
d2$Avg.Monthly.Rainfall <- NULL
write.csv(d2, file = "imd_states_name_1-35_annual-rainfall-edited.csv")</code></pre>
<p><strong>Important:</strong> Before proceeding, we need to ensure that all districts in India has a unique name so that the *District.ID* variable can be used to link rainfall counts of individual districts to their shapes contained in the GADM shapefile (map of districts of India). A look at the reformatted IMD rainfall data file ("imd_states_name_1-35_annual-rainfall-edited.csv") reveals that four sets of district names -- Aurangabad (Bihar and Maharashtra), Hamirpur (Himachal Pradesh and Uttar Pradesh), Junagadh (Daman & Diu and Gujarat), and Raigarh (Chhattisgarh and Maharashtra) -- are repeated in two states each. All these districts are manually renamed in the format of "District Name (State Name)" (such as, "Aurangabad (Bihar)" and "Aurangabad (Maharashtra)"). The same changes of district naming of polygons are done to the GADM shapefile *IND_adm2.shp* and the new shapefile is named *IND_adm2_edited.shp*.</p>
<p>The formula we are using for reocognising a drought year for a district is as follows -- <em>the annual (aggregate) rainfall for that year must be less than 75% of the ten year moving average of annual (aggregate) rainfall for that year for that district.</em></p>
<p>To calculate incidents of drought, a new data table (called a "dataframe" in R) containing the name of all districts and their corresponding ten year moving average annual (aggregate) rainfall for the year 1905, is created using the <a href="http://cran.r-project.org/web/packages/plyr/index.html" target="_blank">plyr library of R</a>.</p>
<pre><code>library(plyr)
r1 <- ddply(d, .(District.ID), summarise, Ten.Year.MA.AR = mean(Annual.Rainfall[Year > 1900 & Year < 1911]))
r1$Year <- 1905
View(r1)</pre></code>
<p>The concept of "ten year moving average annual (aggregate) rainfall for the year 1905" needs to be demystified. It has two parts -- (1) annual (aggregate) rainfall, which is the aggregate rainfall in a district for all the months of 1905, and (2) ten year moving average for the year 1905, which is the average of ten years of rainfall around the year 1905 (calculated by dividing the aggregate rainfall for the period 1901 to 1910 by 10).</p>
<p>To compare the annual (aggregate) rainfall (the variable *Annual.Rainfall*) with the ten year moving average annual (aggregate) rainfall (the variable *Ten.Year.MA.AR*) of the same district for the same year, a subset for 1905 is first taken from the reorganised IMD rainfall data file, which is then merged with the newly created data table that contains the *Ten.Year.MA.AR* variable.</p>
<pre><code>r2 <- subset(d, d$Year == 1905)
m1 <- merge(r2, r1, by.x = "District.ID", all.x = "TRUE", by.y = "District.ID")
View(m1)</pre></code>
<p>A drought year can be identified if the value of *Annual.Rainfall* is less than 75% of the corresponding value of *Ten.Year.MA.AR*. Hence, a new column (*Ten.Year.MA.AR.75*) is generated with values equal to 75% of the ten year moving average for the district concerned. Then, another variable *Drought* is generated that takes the value 1 if *Annual.Rainfall* is lesser than *Ten.Year.MA.AR.75* for the district concerned, and takes the value "0" otherwise.</p>
<pre><code>m1$Ten.Year.MA.AR.75 <- with(m1, Ten.Year.MA.AR * 0.75)
m1$Drought <- 0
m1$Drought [m1$Annual.Rainfall < m1$Ten.Year.MA.AR.75] <- 1
View(m1)</pre></code>
<p>We will use the values taken by the variable *Drought* to decide how the corresponding district is coloured. For that we do an initial checking to see whether there are any districts that were affected by drought in the year concerned.</p>
<pre><code>md <- subset(m1, m1$Drought == "1")
View(md)</pre></code>
<p>Some years may not have any district affected by drought. If all the districts take the value "0" for the variable *Drought*, then we cannot use that variable to colour the districts using the following code. Hence, we add a row (contained in the file named *imd_rainfall_control_01.csv*) that takes the value "1" for the variable *Drought*. This row does not refer to any district, so it will not be rendered in the map that will be generated. This row is added to our table as a control row.</p>
<pre><code>c <- read.csv("imd_rainfall_control_01.csv")
m3 <- rbind(m1,c)</pre></code>
<p>Now the rainfall data has been suitably reorganised to begin the mapping part of the process. It is saved before proceeding to generate the maps.</p>
<pre><code>write.csv(m3, file = "imd_rainfall_ten_year_MA_AR_1905.csv")</pre></code>
<p>The Indian administrative boundaries (shapefile) data file is downloaded from the <a href="http://gadm.org/country" target="_blank">GADM website</a>, and opened using the <code>readOGR</code> command of the <a href="http://cran.r-project.org/web/packages/rgdal/index.html" target="_blank">rgdal library of R</a>. Further, the shapefile data is converted to a R data frame, which can be used by the <a href="http://cran.r-project.org/web/packages/ggplot2/index.html" target="_blank">ggplot2 library</a> for mapping, by using the <code>fortify</code> command.</p>
<pre><code>library(sp)
library(rgdal)
i <- readOGR (dsn = "IND_adm/", layer = "IND_adm2_edited")
library(maptools)
gpclibPermit()
library(ggplot2)
library(scales)
m2 <- fortify(i, region = "NAME_2")</pre></code>
<p>Please note that the Indian administrative boundaries data file from GADM contains state, district and sub-district boundaries. For the purpose of these maps, the district level boundaries are used, by choosing the "IND_adm2_edited" layer, and by fortifying the map data with the "NAME_2" variable that contains the district names. The "IND_adm2_edited" layer has been created by manually editing the "IND_adm2" layer to ensure that all the districts have an unique name (as mentioned above).</p>
<p>The <a href="http://cran.r-project.org/web/packages/ggplot2/index.html" target="_blank">ggplot2 library of R</a> is used to draw the maps. The <code>geom_map</code> function allows easy creation of choropleth maps by combining a data file (stored as *m3* here) and a map file (stored as *m2* here).</p>
<pre><code>ggplot(m3, aes(map_id = District.ID)) + geom_map(aes(fill = Drought), map = m2) + expand_limits(x = m2$long, y = m2$lat) + scale_fill_gradient(low = "#dedede", high = "red", guide = FALSE) + theme(panel.background = element_rect(fill = "white"), axis.line = element_line(color = "white"), axis.ticks = element_line(color = "white"), axis.text = element_text(color = "white"), panel.grid.major = element_line(color = "white"), panel.grid.minor = element_line(color = "white")) + xlab("") + ylab("")</code></pre>
<br />
<h4>Code and Data:</h4>
<br />
<p>The entire R code (as given in the documentation) for this visualisation can be downloaded <a href="https://github.com/ajantriks/iwp/blob/master/R_code/drought_maps.R" target="_blank">from here</a>.</p>
<p>Data (reorganised from the original data shared by IMD) used to create the above charts can also be downloaded <a href="https://github.com/ajantriks/iwp/tree/master/data/drought_maps/" target="_blank">from here</a>.</p>
<br />
<h4>Credits and License:</h4>
<br />
<p>Created by <a href="http://www.ajantriks.net/" target="_blank">Sumandro Chattapadhyay</a> for <a href="http://indiawaterportal.org/" target="_blank">India Water Portal</a>.</p>
<p>All visualisations are developed using <a href="http://cran.r-project.org/" target="_blank">R</a>.</p>
<p>Pages written using <a href="http://twitter.github.com/bootstrap/" target="_blank">Bootstrap</a>, <a href="http://www.google.com/webfonts/" target="_blank">Google Web Fonts</a>, <a href="http://softwaremaniacs.org/soft/highlight/en/" target="_blank">Highlight.js</a> and <a href="http://lokeshdhakar.com/projects/lightbox2/" target="_blank">Lightbox</a>.</p>
<p>Code for all the visualisations is available on <a href="https://github.com/ajantriks/iwp" target="_blank">GitHub</a>.</p>
<p>Code (but not data) is shared under Creative Commons <a href="http://creativecommons.org/licenses/by-sa/3.0/" target="_blank">Attribution-ShareAlike 3.0 Unported</a> license.</p>
<p>Reorganised <a href="https://github.com/ajantriks/iwp/tree/master/data" target="_blank">data</a> has been shared only for the purpose of checking and validating the charts and maps.</p>
<p>It is necessary to take required permission from the original creator of data before re-using it.</p>
<p><strong>Note: Please link back to this page while sharing or re-using this work.</strong></p>
<br />
<br />
</div> <!-- /container -->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="lib/bootstrap/js/jquery.js"></script>
<script src="lib/bootstrap/js/bootstrap-dropdown.js"></script>
<script src="lib/bootstrap/js/bootstrap-collapse.js"></script>
</body>
</html>