-
Notifications
You must be signed in to change notification settings - Fork 1
/
gis_lecture1.html
2109 lines (1982 loc) · 63.2 KB
/
gis_lecture1.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
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- For Google search results -->
<title>ArcGIS for Economics: Lecture 1</title>
<meta name="description" content="Basics of ArcGIS for economics researchers">
<meta name="author" content="Masayuki Kudamatsu">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<!-- Activate Reveal.js -->
<link rel="stylesheet" href="css/reveal.css">
<!-- Define the theme -->
<link rel="stylesheet" href="css/theme/white4me.css" id="theme">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--Add support for earlier versions of Internet Explorer -->
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<!-- To activate the CSS framework of Reveal.js -->
<div class="reveal">
<!-- To reconfigure an HTML5 <section> element as a slide using CSS. -->
<div class="slides">
<!-- Slide contents start here -->
<!-- My own slide templates -->
<section id="title">
<h3 style="color:slategrey">
Causal Inference with Spatial Data
</h3>
<p style="color:slategrey">
(ArcGIS 10 for Economics Research)
</p>
<h3>
Lecture 1
</h3>
<h2>
Introduction
</h2>
<br>
<p>Masayuki Kudamatsu</p>
<p>5 October, 2018</p>
<br>
<p>
<small>Press SPACE to proceed. </small>
<br>
<small>To go back to the previous slide, press SHIFT+SPACE. </small>
</p>
</section>
<section id="road_map" style="text-align: left;">
<h3>
Today's road map
</h3>
<p>
1. Why GIS for economics?
</p>
<p>
2. Satellite images and scanned old maps
</p>
<p>
3. GIS software
</p>
<p>
4. Polygon, polyline, point, and raster
</p>
<p>
5. Coordinate systems
</p>
</section>
<!-- SECTION 1 -->
<section>
<section id="section1">
<h1>
1. Why GIS for economics?
</h1>
</section>
<section id="why_gis1" style="text-align: left;">
<h4>Reason #1</h4>
<h3>
More feasible research questions
</h3>
<p>
Satellite images & old maps <span style="color:slategrey">(this lecture)</span>
</p>
<p>
Merge datasets by proximity <span style="color:slategrey">(Lecture 2)</span>
</p>
<p style="margin-left: 30px;">
e.g., weather data with survey data
</p>
<p>
Estimate the spillover effect on the control group <span style="color:slategrey">(Lecture 3)</span>
</p>
</section>
<section id="why_gis2" style="text-align: left;">
<h4>Reason #2</h4>
<h3>
More credible identification strategy
</h3>
<p>
Control for more covariates / fixed effects <span style="color:slategrey">(Lectures 3, 5)</span>
</p>
<p>
Instruments <span style="color:slategrey">(Lectures 4, 6)</span>
</p>
<p>
RD-design <span style="color:slategrey">(Lectures 7)</span>
</p>
</section>
</section>
<!-- SECTION 2 -->
<section>
<section id="section2">
<h1>
2. Satellite images & old maps
</h1>
</section>
<section id="satellite1a" data-transition="slide-in fade-out" style="text-align: left">
<h4>
Satellite image example #1
</h4>
<h3>Deforestation in Indonesia</h3>
<p>(<a href="http://dx.doi.org/10.1093/qje/qjs034" target="_blank">Burgess et al. 2012</a>)</p>
<p>
# of districts in a province $\uparrow$
</p>
<p>
$\Rightarrow$ Each district govt official engages in Cournot competition in selling (illegal) logging permits
</p>
<p>
$\Rightarrow$ Deforestation in the province $\uparrow$
</p>
</section>
<section id="satellite1b" data-transition="fade" style="text-align: left">
<p>
Cannot rely on official stats of logging
</p>
<p>
$\Rightarrow$ Use satellite images
</p>
<ul style="margin-left: 85px;">
<li>
Spatial resolution: 250m x 250m pixel
</li>
<li>
Data: electromagnetic radiation strength in 36 bands of spectrum
</li>
<li>
Develop algorithm to convert radiation patterns to forest coverage
</li>
</ul>
</section>
<section id="satellite1c" data-transition="fade" >
<h4>
Pixel-level data on deforestation
</h4>
<table>
<tr>
<td>
<img src="gis_lecture1/forest2001a.png" style="border: none; background: none; box-shadow:none;">
</td>
<td>
<img src="gis_lecture1/forest2008a.png" style="border: none; background: none; box-shadow:none;">
</td>
</tr>
</table>
<p>
<small>(Figure I of Burgess et al. 2012) </small>
</p>
</section>
<section id="satellite1d" data-transition="slide-out fade-in" >
<h4 style="text-align: left">
District-level data on deforestation
</h4>
<table>
<tr>
<td>
<img src="gis_lecture1/forest2001b.png" style="border: none; background: none; box-shadow:none; width: 400px;">
</td>
</tr>
<tr>
<td>
<img src="gis_lecture1/forest2008b.png" style="border: none; background: none; box-shadow:none; width: 400px;">
</td>
</tr>
</table>
<p>
<small>(Figure II of Burgess et al. 2012) </small>
</p>
<ul class="fragment" data-fragment-index="1" style="text-align: left">
<li>
<span style="color:slategrey">We will learn how to aggregate satellite image data into administrative zones in Lecture 5</span>
</li>
</ul>
</section>
<section id="satellite2a" data-transition="slide-in fade-out" style="text-align: left">
<h4>
Satellite image example #2
</h4>
<h3>Nighttime light 1992</h3>
<p><small>(Source: <a href="http://ngdc.noaa.gov/eog/dmsp/downloadV4composites.html" target="_blank">Version 4 DMSP-OLS Nighttime Lights Time Series</a>)</small></p>
<img src="gis_lecture1/lights1992.png" style="border: none; background: none; box-shadow:none; width:900px;">
</section>
<section id="satellite2b" data-transition="fade" style="text-align: left">
<h4>
Satellite image example #2
</h4>
<h3>Nighttime light 2013</h3>
<p><small>(Source: <a href="http://ngdc.noaa.gov/eog/dmsp/downloadV4composites.html" target="_blank">Version 4 DMSP-OLS Nighttime Lights Time Series</a>)</small></p>
<img src="gis_lecture1/lights2013.png" style="border: none; background: none; box-shadow:none; width:900px;">
</section>
<section id="satellite2c" data-transition="slide-out fade-in" style="text-align: left">
<h3>
Nighttime light in top 5 econ journals
</h3>
<p>
<a href="http://dx.doi.org/10.1257/aer.102.2.994" target="_blank">Henderson et al (2012)</a>: correlate with real GDP growth
</p>
<p>
<a href="http://dx.doi.org/10.1093/qje/qjw003" target="_blank">Pinkovskiy & Sala-i-Martin (2016)</a>: accuracy of GDP versus household surveys
</p>
<p>
Michalopoulos & Papaioannou (<a href="http://dx.doi.org/10.3982/ECTA9613" target="_blank">2013</a>, <a href="http://dx.doi.org/10.1093/qje/qjt029" target="_blank">2014</a>), <a href="http://dx.doi.org/10.1086/685300" target="_blank">Alesina et al (2016)</a>: measure ethnicity-level development in Africa
</p>
<p>
<a href="http://dx.doi.org/10.1093/qje/qju004" target="_blank">Hodler & Raschky (2014)</a>: Presidents' home region brighter
</p>
<p>
<a href="http://dx.doi.org/10.1093/restud/rdw020" target="_blank">Storeygard (2016)</a>: Impact of trade infrastructure in Africa
</p>
<p>
<a href="http://dx.doi.org/10.1093/qje/qjx030" target="_blank">Henderson et al (2018)</a>: Geographic correlates of light
</p>
<p>
<a href="http://dx.doi.org/10.1093/qje/qjx050">Campante and Yanagizawa-Drott (2018)</a>: Impact of air links
</p>
</section>
<section id="satellite3" data-transition="slide-out slide-in" style="text-align: left">
<p>
For more satellite image examples, see a survey by <a href="http://doi.org/10.1257/jep.30.4.171">Donaldson and Storeygard (2016)</a>.
</p>
</section>
<section id="oldmap1a" data-transition="slide-in fade-out" style="text-align: left">
<h4>
Old map example #1
</h4>
<h3>Road building in Kenya</h3>
<p>(<a href="http://dx.doi.org/10.1257/aer.20131031" target="_blank">Burgess et al. 2015</a>)</p>
<p>
Digitize Michelin maps for Kenya since 1961
</p>
<p>
Track road network expansion over time
</p>
<ul class="fragment" data-fragment-index="1" >
<li>
<span style="color:slategrey" >We will learn line length calculation in Lectures 6 and 7</span>
</li>
</ul>
<p>
See if the president's ethnic group gets more roads built than other groups
</p>
</section>
<section id="oldmap1b" data-transition="slide-out fade-in" >
<h4>
Digitizing old maps
</h4>
<img src="gis_lecture1/BurgessRoads1.png" style="border: none; background: none; box-shadow:none; width: 700px;">
<p>
<small>(source: <a href="http://siteresources.worldbank.org/DEC/Resources/84797-1257266550602/JedwabR.pdf" target="_blank">Remi Jedwab's presentation slide</a>)</small>
</p>
<aside class="notes">
<ul>
<li>
</li>
<li>
</li>
</ul>
</aside>
</section>
<section id="oldmap2a" data-transition="slide-in fade-out" style="text-align: left">
<h4>
Old map example #2
</h4>
<h3>Ethnic homelands in Africa</h3>
<p>
Drawn by <a href="https://books.google.com/books?id=RdTGQic7KMUC" target="_blank">Murdock (1959)</a>
</p>
<p>
Digitized by <a href="http://dx.doi.org/10.1162/qjec.2008.123.1.139" target="_blank">Nunn (2008)</a>, to match ethnicity-level data on slave trade with country-level data <span style="color:slategrey">(Lecture 4)</span>
</p>
<p>
Also used by <a href="http://dx.doi.org/10.1257/aer.20130604" target="_blank">Alsan (2015)</a> <span style="color:slategrey">(Lecture 2)</span>
</p>
<p>
Other examples: <a href="http://dx.doi.org/10.1257/aer.101.7.3221" target="_blank">Nunn & Wantchekon (2011)</a>, Michalopoulos & Papaioannou (<a href="http://dx.doi.org/10.3982/ECTA9613" target="_blank">2013</a>, <a href="http://dx.doi.org/10.1093/qje/qjt029" target="_blank">2014</a>, <a href="http://doi.org/10.1257/aer.20131311" target="_blank">2016</a>), <a href="http://dx.doi.org/10.1086/685300" target="_blank">Alesina et al. (2016)</a>
</p>
</section>
<section id="oldmap2b" data-transition="slide-out fade-in" >
<h4>
Ethnic homeland & country boudaries
</h4>
<img src="gis_lecture1/ethnicboundary.png" style="border: none; background: none; box-shadow:none; width: 600px;">
<p>
<small>Figure II of <a href="http://dx.doi.org/10.1162/qjec.2008.123.1.139" target="_blank">Nunn (2008)</a></small>
</p>
<aside class="notes">
<ul>
<li>
</li>
<li>
</li>
</ul>
</aside>
</section>
<section id="practical_tips" style="text-align: left;">
<h3>
Practical advice
</h3>
<p>
<strong>Satellite images</strong>: some are freely available but very costly (time & money) to process
</p>
<ul>
<li>
See <a href="http://gisgeography.com/free-satellite-imagery-data-list/" target="_blank">"15 Free Satellite Imagery Data Sources"</a> by GIS Geography
</li>
<li>
An example of constructing data from satellite images: <a href="http://blogs.worldbank.org/impactevaluations/measuring-yields-space" target="_blank">Measuering Yields from Space</a>
</li>
</ul>
</section>
<section id="practical_tips2" style="text-align: left;">
<h4>
Practical advice (cont.)
</h4>
<p>
<strong>Old maps</strong>: digitizing is also time-consuming but feasible with patience in two steps:
</p>
<ol>
<li>
Georeferencing
</li>
<ul>
<li>
<a href="http://www.library.yale.edu/MapColl/files/docs/03-Geocoding%20&%20Georeferencing%20in%20ArcGIS.pdf" target="_blank">Yale Map Collection (2009)</a> (pp. 8-10)
</li>
<li>
<a href="http://desktop.arcgis.com/en/arcmap/10.3/manage-data/raster-and-images/fundamentals-for-georeferencing-a-raster-dataset.htm" target="_blank">ArcGIS Help: Georeferencing a raster dataset</a>
</li>
<li>
<a href="https://na-mii.com/gis/na_gis99/">How to georeference Meiji/Taisho-era maps of Japan</a> (in Japanese)
</li>
</ul>
<li>
Create vector data
</li>
<ul>
<li>
<a href="http://wikis.evergreen.edu/computing/index.php/ArcGIS_10:_Editing_%26_Creating_Your_Own_Shapefiles" target="_blank">ArcGIS 10: Editing & Creating Your Own Shapefiles</a> (Parts 3-4)
</li>
</ul>
</ol>
<p class="fragment" data-fragment-index="1">
$\Rightarrow$ This course helps you <strong>use</strong> these datasets
</p>
</section>
</section>
<section>
<section id="section3">
<h1>
3. GIS software
</h1>
</section>
<section id="gis_software" style="text-align: left;">
<p>
<strong>ArcGIS</strong>
</p>
<ul>
<li>
Python-friendly
</li>
<li>
Buggy; tricky to create map images; Windows only
</li>
</ul>
<p>
<strong>QGIS</strong>
</p>
<ul>
<li>
Free; easy to create map images; compatible with any OS
</li>
<li>
Python-unfriendly
</li>
<li>
Tutorials:
</li>
<ul>
<li><a href="http://www.qgistutorials.com" target="_blank">www.qgistutorials.com</a> for interactive use</li>
<li><a href="https://www.packtpub.com/application-development/qgis-python-programming-cookbook-second-edition" target="_blank">Lawhead (2017)</a> for Python coding</li>
</ul>
</ul>
<p class="fragment" data-fragment-index="1">
$\Rightarrow$ For the ease of use of Python (for replication), we will learn ArcGIS
</p>
</section>
<section id="gis_software2" style="text-align: left;">
<p>
<strong>R</strong>
</p>
<ul>
<li>
Can be integrated into statistical analysis
</li>
<li>
Tedious to browse data
</li>
<li>
Textbook: <a href="https://books.google.se/books?id=kje2ngEACAAJ" target="_blank">Brunsdon & Comber (2015)</a>
</li>
<li><a href="http://www.nickeubank.com/gis-in-r/" target="_blank">Tutorial by Nick Eubank</a></li>
</ul>
<p>
<strong><a href="http://geopandas.org/" target="_blank">Geopandas</a></strong>
</p>
<ul>
<li>
A Python library to work on spatial data
</li>
<li>
Still under development (as of July 2018)
</li>
</ul>
</section>
<section id="arcgis" style="text-align: left;">
<p>
<strong>Purchasing ArcGIS</strong>
</p>
<p>License fee (in case of Japan): 18,000 yen per year</p>
<ul>
<li>Price plan differs across countries.</li>
<li>Contact ESRI of your country.</li>
</ul>
<p>Make sure the package you buy include:</p>
<ul>
<li>
<a href="https://www.esri.com/en-us/store/arcgis-desktop/arcgis-desktop-advanced" target="_blank">ArcGIS Desktop Advanced</a>
<ul>
<li>You cannot upgrade from <a href="https://www.esri.com/en-us/store/arcgis-desktop/arcgis-desktop-basic" target="_blank">Basic</a> or <a href="https://www.esri.com/en-us/store/arcgis-desktop/arcgis-desktop-standard" target="_blank">Standard</a></li>
</ul>
</li>
<li>
<a href="https://www.esri.com/en-us/store/extensions/arcgis-spatial-analyst" target="_blank">ArcGIS Spatial Analyst extension</a>
<ul>
<li>For working on raster data <span style="color:slategrey">(Lectures 5-8)</span></li>
</ul>
</li>
<li>
<a href="https://www.esri.com/en-us/store/extensions/arcgis-3d-analyst" target="_blank">ArcGIS 3D Analyst extension</a>
<ul>
<li>If working on three-dimensional spatial data <span style="color:slategrey">(Lecture 7)</span></li>
</ul>
</li>
</ul>
</section>
</section>
<section>
<section id="setup-windows10a" data-transition="slide-in fade-out" style="text-align: left;">
<h3>
Set up Windows 10 environment <br> for this course
</h3>
<p>
1. Show file extensions (<code>.shp</code> etc) in File Explorer
</p>
<ul>
<li>
Click <img style="border:none; vertical-align: middle; width: 50px;" src="gis_lecture1/file-explore-icon.png" alt="">on the task bar at the bottom
</li>
<li>
In the menu bar, click <span style="background-color: Gainsboro">View</span>
</li>
<li>
Check "File name extensions" in the <span style="background-color: Gainsboro">Show/hide</span> pane
</li>
</ul>
</section>
<section id="setup-windows10b" data-transition="fade-in fade-out" style="text-align: left;">
<h4>
Set up Windows 10 environment <br> for this course (cont.)
</h4>
<p>
2. Install <a href="https://7-zip.org/" target="_blank">7-Zip</a> for 64-bit Windows
</p>
<ul>
<li>
For uncompressing <code>.tar</code> files
</li>
</ul>
</section>
<!-- <section id="setup-windows10c" data-transition="fade-in slide-out" style="text-align: left;">
<h4>
Set up Windows 10 environment <br> for this course (cont.)
</h4>
<p>
3. Install <a href="https://atom.io/" target="_blank">Atom editor</a> and its <a href="https://atom.io/packages/script" target="_blank">Script</a> package
</p>
<ul style="margin-left: 72px;">
<li>
For writing and running Python scripts from Lecture 2
</li>
<li>
To install Script, click <span style="background-color: Gainsboro">File > Settings > Install</span>, and then search for "Script"
</li>
</ul>
</section> -->
</section>
<section>
<section id="preparation1" data-transition="slide-in fade-out" style="text-align: left;">
<h3>
Prepare for the rest of this lecture
</h3>
<p>
1. Launch ArcMap 10 (it takes time)
</p>
<p>
2. <a href="https://www.dropbox.com/s/v85wuszgyx61a1b/Lecture1.zip?dl=1" target="_blank">Download the zipped dataset for lecture 1</a>
</p>
<p>
3. Save it to <strong>Desktop</strong> (<code>C:\\Users\\<em>yourname</em>\\Desktop</code>)
</p>
<ul style="margin-left: 72px;">
<li>
Don't save in the remote server, which slows down ArcGIS
</li>
</ul>
<p>
4. Right-click it and choose <span style="background-color: Gainsboro">7-Zip > Extract to "Lecture1\"</span>
</p>
<ul style="margin-left: 72px;">
<li>
So the directory path will be: <code>C:\\Users\\<em>yourname</em>\\Desktop\\Lecture1</code>
</li>
</ul>
</section>
<section id="preparation2" data-transition="fade-out fade-in" style="text-align: left;">
<h4>
Prepare for the rest of this lecture (cont.)
</h4>
<p>
Browse the inside of the <code>Lecture1</code> folder
</p>
<p>
I've created 4 folders:
</p>
<ul style="margin-left: 72px;">
<li>
<code>code/</code>: files to edit datasets (e.g. Python scripts)
</li>
<li>
<code>input/</code>: original data
</li>
<li>
<code>output/</code>: final data to be used for analysis
</li>
<li>
<code>temporary/</code>: other files created during process
</li>
</ul>
<p>
It's a standard directory structure to organize files for empirical analysis
<ul>
<li>cf. Chapter 4 of <a href="http://web.stanford.edu/~gentzkow/research/CodeAndData.pdf">Gentzkow and Shapiro (2014)</a></li>
</ul>
</p>
</section>
<section id="preparation3" data-transition="slide-out fade-in" style="text-align: left;">
<h4>
Prepare for the rest of this lecture (cont.)
</h4>
<p>
Now browse the <code>input/</code> folder
</p>
<p>
5. Right-click all the .zip files and select <span style="background-color: Gainsboro">7-Zip > Extract Here</span>
</p>
<ul>
<li>
<code>10m-rivers-lake-centerlines.zip</code>
<ul>
<li style="color: grey;">river polylines</li>
</ul>
</li>
<li>
<code>gadm36.zip</code>
<ul>
<li style="color: grey;">country/district polygons</li>
</ul>
</li>
<li>
<code>glds90ag.zip</code>
<ul>
<li style="color: grey;">population density raster</li>
</ul>
</li>
</ul>
<p>
Leave <code>F162008.v4.tar</code> (nighttime light raster) <br>for the time being.
</p>
</section>
</section>
<!-- SECTION 4 -->
<section>
<section id="section4">
<h1>
4. Polygon, polyline, point, and raster
</h1>
</section>
<section id="datatype" style="text-align: left;">
<h3>
Vector vs Raster
</h3>
<p>Spatial data comes in two different formats</p>
<img src="gis_lecture1/vector-raster.jpg" style="border: none; background: none; box-shadow:none; width: 300px;">
<p>How to edit data differs a lot between them</p>
<p>We now learn how to browse spatial datasets in ArcGIS while learning these different formats of spatial data
</section>
<section id="vector" style="text-align: left;">
<h3>
Vector data
</h3>
<p>
Each spatial unit in vector data is called a <strong>feature</strong>
</p>
<p>
Three types of a feature:
</p>
<ol style="margin-left: 60px;">
<li>Polygon</li>
<li>Polyline</li>
<li>Point</li>
</ol>
<p>
A set of features of the same type: a <strong>feature class</strong>
</p>
<p>
File format: <strong>Shapefile</strong> (.shp)
</p>
</section>
<section id="polygon" data-transition="slide-in fade-out" style="text-align: left;">
<h4>
Vector data #1
</h4>
<h3>
Polygon features
</h3>
<p>
Represent geographic zones
</p>
<ul>
<li>Countries <span style="color:slategrey">(Lectures 4 & 5)</span></li>
<li>Sub-national districts <span style="color:slategrey">(Lecture 6)</span></li>
<li>Ethnic homelands <span style="color:slategrey">(Lectures 4 & 5)</span></li>
<li>Lakes, Islands, etc.</li>
<li>Grid cells <span style="color:slategrey">(Lectures 2 & 5)</span></li>
</ul>
</section>
<section id="ex1a" data-transition="fade-in fade-out" style="text-align: left;">
<h4>
Exercise #1
</h4>
<h3>
Browse polygon features
</h3>
<p>
Data to be read: <a href="https://gadm.org/" target="_blank">GADM</a> (widely used by economists)
</p>
<ul>
<li>
<code>gadm36/gadm36_0.shp</code> (countries)
</li>
<li>
<code>gadm36/gadm36_2.shp</code> (subnational districts)
</li>
</ul>
<p>
Drag these files in Catalog Window to Data Frame
</p>
<ul>
<li>
Don't see Catalog Window on the right?
</li>
<li>
Don't see the data directory in Catalogue Window?
</li>
<li>
See next slide...
</li>
</ul>
</section>
<section id="ex1a_extra" data-transition="slide-out fade-in" style="text-align: left;">
<h4>
Exercise #1 (cont.)
</h4>
<p>
If you don't see Catalog Window...
</p>
<p>
$\Rightarrow$ Click <span style="background-color: Gainsboro">Windows</span> in the menu bar
</p>
<p>
If you don't see the data directory in Catalogue Window...
</p>
<p>
$\Rightarrow$ Right-click <span style="background-color: Gainsboro">Folder Connections</span> and click <span style="background-color: Gainsboro">Connect To Folder...</span>
</p>
</section>
<section id="polyline" data-transition="slide-in fade-out" style="text-align: left;">
<h4>
Vector data #2
</h4>
<h3>
Polyline features
</h3>
<p>
Represent networks / routes
</p>
<ul>
<li>Roads <span style="color:slategrey">(Lecture 7)</span></li>
<li>Rivers <span style="color:slategrey">(Lecture 6)</span></li>
<li>Coastlines <span style="color:slategrey">(Lecture 4)</span></li>
</ul>
</section>
<section id="ex2a" data-transition="fade-in fade-out" style="text-align: left;">
<h4>
Exercise #2
</h4>
<h3>
Browse polyline features
</h3>
<p>
Data to be read: <a href="https://www.naturalearthdata.com/" target="_blank">Natural Earth</a>'s <a href="https://www.naturalearthdata.com/downloads/10m-physical-vectors/10m-rivers-lake-centerlines/" target="_blank">Rivers and Lake Centerlines</a> data (<code>10m_rivers_lake_centerlines.shp</code>)
</p>
<p>
Browse this data (cf. <a href="#ex1a">Exercise 1</a>)
</p>
<p>
Uncheck the subnational boundary data in Table of Contents
</p>
<ul>
<li>
If you don't see Table of Contents, click <span style="background-color: Gainsboro">Windows</span> in the menu bar.
</li>
</ul>
<p>
$\Rightarrow$ Now rivers are shown on national boundaries.
</p>
</section>
<section id="ex2b" data-transition="fade" style="text-align: left;">
<h4>
Exercise #2 (cont.)
</h4>
<p>
Change the color of rivers to blue.
</p>
<ul>
<li>
Click the symbol (in this case, colored line) just below the data name in Table of Contents.
</li>
<li>
Choose the preferred color.
</li>
</ul>
</section>
<section id="ex2c" data-transition="slide-out fade-in" style="text-align: left;">
<p>
If you read the river data first and then the national boundary data, the river data would be hidden below the national boundary data.
</p>
<ul>
<li>
In the Table of Contents window (the one on the left), drag the river data and drop it above the national boundary data.
</li>
<li>
Then rivers will show up
</li>
</ul>
<p>
If you cannot drag the data in the Table of Contents window, check if the List By Drawing Order icon is selected on top left.
</p>
<img src="gis_lecture1/toc.png" style="border: none; background: none; box-shadow:none; width: 400px;">
</section>
<section id="point" data-transition="slide-in fade-out" style="text-align: left;">
<h4>
Vector data #3
</h4>
<h3>
Point features
</h3>
<p>
Represent point location
</p>
<ul>
<li>Plots <span style="color:slategrey">(Lecture 3)</span></li>
<li>Schools</li>
<li>Cities <span style="color:slategrey">(Exercise #3 below)</span></li>
<li>Centroid of polygon <span style="color:slategrey">(Lecture 4)</span></li>
</ul>
<p>
Can easily be created from <strong>XY data</strong>
</p>
</section>
<section id="xydata1" data-transition="fade" style="text-align: left;">
<h3>
What is XY Data?
</h3>
<p>
Each row: point feature
</p>
<p>
Column 1: longitude (x value)
</p>
<p>
Column 2: latitude (y value)
</p>
<p>
Other columns: attributes of point feature
</p>
<ul>
<li>Location name</li>
<li>Statistics</li>
<li>Key (i.e. unique ID)</li>
<li>Foreign keys (for merging with other data)</li>
</ul>
</section>
<section id="xydata2" data-transition="fade" style="text-align: left;">
<h3>
How to obtain longitude & latitude?
</h3>
<p>
<strong>1. GPS receivers</strong>
</p>
<p>
If you conduct your own survey
</p>
<ul>
<li>
<a href="http://dhsprogram.com/publications/publication-dhsm9-dhs-questionnaires-and-manuals.cfm" target="_blank">Measure DHS (2013)</a> for the protocol to use GPS receivers
</li>
<li>
<a href="http://www.library.yale.edu/MapColl/files/docs/GPS%20to%20GIS%20for%20Management%20Plans.doc" target="_blank">Matt Decker (2011)</a> for using a Garmin handheld unit to gather GPS data
</li>
</ul>
</section>
<section id="xydata2b" data-transition="fade" style="text-align: left;">
<h4>
How to obtain longitude & latitude? (cont.)
</h4>
<p>
<strong>2. Online gazetteer</strong>
</p>
<p>
If location names are available, search at:
</p>
<ul>
<li>
<a href="http://www.geonames.org" target="_blank">Geonames</a>
</li>
<ul>
<li>To automate search, use
<a href="https://blogs.esri.com/esri/arcgis/2012/01/06/geonames-tools-toolbox-is-available-for-download/" target="_blank">Geonames Tools toolbox</a>
</li>
</ul>
<li>
<a href="http://www.fallingrain.com/world" target="_blank">Global Gazetteer Version 2.3</a>
</li>
<li>
<a href="http://dma.jrc.it/services/fuzzyg/" target="_blank">JRC Fuzzy Gazetteer</a>
</li>
</ul>
<p class="fragment" data-fragment-index="1">
See <a href="http://www.samfak.uu.se/digitalAssets/83/a_83721-f_ucdp_ged_v.1.0-codebook.pdf" target="_blank">Sundberg et al. (2010)</a> for an example protocol
</p>
</section>
<section id="xydata2c" data-transition="fade" style="text-align: left;">
<h4>
How to obtain longitude & latitude? (cont.)
</h4>
<p>
<strong>3. Geocoding tools</strong>
</p>
<p>
If postal address is available, use:
</p>
<ul>
<li>
<a href="https://developers.google.com/maps/documentation/geocoding/start">Google Geocoder</a>
</li>
<li>
<a href="http://newspat.csis.u-tokyo.ac.jp/geocode/modules/addmatch/index.php?content_id=1">CSV Address Matching Service</a> for addresses in Japanese
</li>
</ul>
</section>
<section id="xydata3" data-transition="fade-in fade-out" style="text-align: left;">
<h3>
To import XY data to ArcGIS
</h3>
<p>
Data format: Comma-delimited text (csv) / Excel worksheet
</p>
<ul>
<li>
From Stata, use <code>export delimited</code> (<a href="https://www.stata.com/manuals13/dimportdelimited.pdf">Stata help</a>)
</li>
<ul>
<li>
ArcGIS may round off longitude & latitude values
</li>
<li>
Use the "format" command to avoid this (cf. <a href="https://www.stata.com/help.cgi?format">Stata help</a>)
</li>
</ul>
</ul>
<p>
<small>Code example for 10 dicimal digits for longitude/latitude</small>
</p>
<pre style="font-size: 0.6em;">
<code data-trim data-noescape>
format lon %15.10f
format lat %14.10f