class: center, middle, inverse, title-slide .title[ # Session 6 - Spatial Data ] .subtitle[ ##
R for Stata Users
] .author[ ### Luiza Andrade, Rob Marty, Rony Rodriguez-Ramirez, Luis Eduardo San Martin, Leonardo Viotti ] .date[ ### The World Bank – DIME |
WB Github
March 2024 ] --- # Table of contents .large[ 1. Overview of GIS concepts 2. Load and explore polygons, polylines, and points 3. Static maps 4. Interactive maps 5. Spatial operations applied on one dataset 6. Spatial operations applied on multiple datasets ] --- # Overview of GIS conceps __Spatial data:__ The two main types of spatial data are __vector data__ and __raster data__ .pull-left[ __Vector data__ * Points, lines, or polygons * Common file formats include shapefiles (.shp) and geojsons (.geojson) * Examples: polygons on countries, polylines of roads, points of schools ] .pull-right[ __Raster data__ * Spatially referenced grid * Common file format is a geotif (.tif) * Example: Satellite imagery of nighttime lights ] .center[ <img src="img/Simple_vector_map.svg.png" width = 300> <img src="img/raster.png" width = 300> ] --- # Coordinate Reference Systems (CRS) * Coordinate reference systems use pairs of numbers to define a location on the earth * For example, the World Bank is at a latitude of 38.89 and a longitude of -77.04 .center[ <img src="img/googlemaps_worldbank.png" width = 700> ] --- # Coordinate Reference Systems (CRS) There are many different coordinate reference systems, which can be grouped into __geographic__ and __projected__ coordinate reference systems. Geographic systems live on a sphere, while projected systems are “projected” onto a flat surface. .center[ <img src="img/geo_proj_crs.png" width = 800> ] --- # Geographic Coordinate Systems .pull-left[ __Units:__ Defined by latitude and longitude, which measure angles and units are typically in decimal degrees. (Eg, angle is latitude from the equator). __Latitude & Longitude:__ * On a grid X = longitude, Y = latitude; sometimes represented as (longitude, latitude). * Also has become convention to report them in alphabetical order: (latitude, longitude) — such as in Google Maps. * Valid range of latitude: -90 to 90 * Valid range of longitude: -180 to 180 * __{Tip}__ Latitude sounds (and looks!) like latter. ] .center[ <img src="img/longlat.png" width = 500> ] --- # Geographic Coordinate Systems .pull-left[ __Distance on a sphere__ * At the equator (latitude = 0), a 1 decimal degree longitude distance is about 111km; towards the poles (latitude = -90 or 90), a 1 decimal degree longitude distance converges to 0 km. * We must be careful (ie, use algorithms that account for a spherical earth) to calculate distances! The distance along a sphere is referred to as a [great circle distance](https://en.wikipedia.org/wiki/Great-circle_distance). * Multiple options for spherical distance calculations, with trade-off between accuracy & complexity. (See distance section for details). ] .pull-right[ .center[ <img src="img/longitude_distance.png" width = 300> ] .center[ <img src="img/greatcircle.png" width = 400> ] ] --- # Geographic Coordinate Systems .pull-left[ __Datums__ * __Is the earth flat?__ No! * __Is the earth a sphere?__ No! * __Is the earth a lumpy ellipsoid?__ [Yes!](https://oceanservice.noaa.gov/facts/earth-round.html#:~:text=The%20Earth%20is%20an%20irregularly%20shaped%20ellipsoid.&text=While%20the%20Earth%20appears%20to,unique%20and%20ever%2Dchanging%20shape.) The earth is a lumpy ellipsoid, a bit flattened at the poles. * A [datum](https://www.maptoaster.com/maptoaster-topo-nz/articles/projection/datum-projection.html) is a model of the earth that is used in mapping. One of the most common datums is [WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System), which is used by the Global Positional System (GPS). * A datum is a reference ellipsoid that approximates the shape of the earth. * Other datums exist, and the latitude and longitude values for a specific location will be different depending on the datum. ] .pull-right[ .center[ <img src="img/datum1.png" width = 300> ] .center[ <img src="img/datum2.png" width = 300> ] ] --- # Projected Coordinate Systems .pull-left[ Projected coordinate systems project spatial data from a 3D to 2D surface. __Distortions:__ Projections will distort some combination of distance, area, shape or direction. Different projections can minimize distorting some aspect at the expense of others. __Units:__ When projected, points are represented as “northings” and “eastings.” Values are often represented in meters, where northings/eastings are the meter distance from some reference point. Consequently, values can be very large! __Datums still relevant:__ Projections start from some representation of the earth. Many projections (eg, [UTM](https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system)) use the WGS84 datum as a starting point (ie, reference datum), then project it onto a flat surface. ] .pull-right[ Click [here](https://www.youtube.com/watch?v=eLqC3FNNOaI) to see why Toby & CJ are confused (hint: projections!) .center[ <img src="img/westwing.png" width = 400> ] .center[ <img src="img/mercator_galls.png" width = 400> ] ] --- # Projected Coordinate Systems .center[ <img src="img/map_xkcd.png" width = 1000> ] --- # Referencing coordinate reference systems .large[ * There are many ways to reference coordinate systems, some of which are verbose. * __PROJ__ (Library for projections) way of referencing WGS84 `+proj=longlat +datum=WGS84 +no_defs +type=crs` * __[EPSG](https://epsg.io/)__ Assigns numeric code to CRSs to make it easier to reference. Here, WGS84 is `4326`. ] --- # Coordinate Reference Systems Whenever have spatial data, need to know which coordinate reference system (CRS) the data is in. * You wouldn’t say __“I am 5 away”__ * You would say __“I am 5 [miles / kilometers / minutes / hours] away”__ (units!) * Similarly, a “complete” way to describe location would be: I am at __6.51 latitude, 3.52 longitude using the WGS 84 CRS__ --- # Introduction - This session could be a whole course on its own, but we only have an hour and half. - To narrow our subject, we will focus on only one type of spatial data, vector data. - This is the most common type of spatial data that non-GIS experts will encounter in their work. - We will use the `sf` package, which is the tidyverse-compatible package for geospatial data in R. - For visualizing, we'll rely on `ggplot2` for static maps and `leaflet` for interactive maps --- # Setup 1. Copy/paste the following code into a new RStudio script, __replacing "YOURFOLDERPATHHERE" with the folder within which you'll place this R project__: ```r library(usethis) use_course( url = "https://github.com/worldbank/dime-r-training/archive/main.zip", destdir = "YOURFOLDERPATHHERE" ) ``` 2\. In the console, type in the requisite number to delete the .zip file (we don't need it anymore). 3\. A new RStudio environment will open. Use this for the session today. --- # Setup Install new packages ```r install.packages(c("sf", "leaflet", "geosphere"), dependencies = TRUE) ``` And load them ```r library(here) library(tidyverse) library(sf) # Simple features library(leaflet) # Interactive map library(geosphere) # Great circle distances ``` --- # Load and explore polylines, polylines, and points The main package we'll rely on is the `sf` (simple features) package. With `sf`, spatial data is structured similarly to a __dataframe__; however, each row is associated with a __geometry__. Geometries can be one of the below types. .center[ <img src="img/geom_types.png" width = 400> ] --- # Load and explore polygon The first thing we will do in this session is to recreate this data set: ```r country_sf <- st_read(here("DataWork", "DataSets", "Final", "country.geojson")) ``` ``` ## Reading layer `country' from data source ## `/Users/robmarty/Documents/Github/dime-r-training/DataWork/DataSets/Final/country.geojson' ## using driver `GeoJSON' ## Simple feature collection with 300 features and 13 fields ## Geometry type: MULTIPOLYGON ## Dimension: XY ## Bounding box: xmin: 33.90959 ymin: -4.720417 xmax: 41.92622 ymax: 5.061166 ## Geodetic CRS: WGS 84 ``` --- # Exploring the data Look at first few observations ```r head(country_sf) ``` ``` ## Simple feature collection with 6 features and 13 fields ## Geometry type: MULTIPOLYGON ## Dimension: XY ## Bounding box: xmin: 35.52292 ymin: -0.198901 xmax: 36.29659 ymax: 0.990413 ## Geodetic CRS: WGS 84 ## GID_2 GID_0 COUNTRY GID_1 NAME_1 NL_NAME_1 NAME_2 VARNAME_2 ## 1 KEN.1.1_1 KEN Kenya KEN.1_1 Baringo <NA> 805 <NA> ## 2 KEN.1.2_1 KEN Kenya KEN.1_1 Baringo <NA> Baringo Central <NA> ## 3 KEN.1.3_1 KEN Kenya KEN.1_1 Baringo <NA> Baringo North <NA> ## 4 KEN.1.4_1 KEN Kenya KEN.1_1 Baringo <NA> Baringo South <NA> ## 5 KEN.1.5_1 KEN Kenya KEN.1_1 Baringo <NA> Eldama Ravine <NA> ## 6 KEN.1.6_1 KEN Kenya KEN.1_1 Baringo <NA> Mogotio <NA> ## NL_NAME_2 TYPE_2 ENGTYPE_2 CC_2 HASC_2 ## 1 <NA> Constituency Constituency 162 <NA> ## 2 <NA> Constituency Constituency 159 <NA> ## 3 <NA> Constituency Constituency 158 <NA> ## 4 <NA> Constituency Constituency 160 <NA> ## 5 <NA> Constituency Constituency 162 <NA> ## 6 <NA> Constituency Constituency 161 <NA> ## geometry ## 1 MULTIPOLYGON (((35.87727 -0... ## 2 MULTIPOLYGON (((35.7977 0.3... ## 3 MULTIPOLYGON (((35.81346 0.... ## 4 MULTIPOLYGON (((36.22934 0.... ## 5 MULTIPOLYGON (((35.82341 0.... ## 6 MULTIPOLYGON (((36.10947 0.... ``` --- # Exploring the data Number of rows ```r nrow(country_sf) ``` ``` ## [1] 300 ``` --- # Exploring the data Check coordinate reference system ```r st_crs(country_sf) ``` ``` ## Coordinate Reference System: ## User input: WGS 84 ## wkt: ## GEOGCRS["WGS 84", ## DATUM["World Geodetic System 1984", ## ELLIPSOID["WGS 84",6378137,298.257223563, ## LENGTHUNIT["metre",1]]], ## PRIMEM["Greenwich",0, ## ANGLEUNIT["degree",0.0174532925199433]], ## CS[ellipsoidal,2], ## AXIS["geodetic latitude (Lat)",north, ## ORDER[1], ## ANGLEUNIT["degree",0.0174532925199433]], ## AXIS["geodetic longitude (Lon)",east, ## ORDER[2], ## ANGLEUNIT["degree",0.0174532925199433]], ## ID["EPSG",4326]] ``` --- # Exploring the data Plot the data. To plot using `ggplot2`, we use the `geom_sf` geometry. ```r ggplot() + geom_sf(data = country_sf) ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-8-1.png" width="60%" style="display: block; margin: auto;" /> --- # Attributes of data We want the area of each location, but we don't have a variable for area ```r names(country_sf) ``` ``` ## [1] "GID_2" "GID_0" "COUNTRY" "GID_1" "NAME_1" "NL_NAME_1" ## [7] "NAME_2" "VARNAME_2" "NL_NAME_2" "TYPE_2" "ENGTYPE_2" "CC_2" ## [13] "HASC_2" "geometry" ``` --- # Attributes of data Determine area. Note the CRS is spherical (WGS84), but `st_area` gives area in meters squared. R uses s2 geomety for this. ```r st_area(country_sf) ``` ``` ## Units: [m^2] ## [1] 174612548 664171032 1640235288 1893541200 909726196 1162391322 ## [7] 4446442673 244343146 319588761 546475821 791703635 487034695 ## [13] 347077424 234870080 320531683 178295354 302805234 267396640 ## [19] 950722974 208724111 377069605 235040170 166654802 311166355 ## [25] 244842707 270856300 195816268 234613620 250070745 300226047 ## [31] 544675636 890441628 819095221 562423505 473818437 774008353 ## [37] 1329273270 340468166 4248579388 7557295525 16712310204 603028994 ## [43] 8442761951 6483073596 270237144 247974418 626536513 259329880 ## [49] 1032562720 699140857 292011673 1147576864 124531035 15430646699 ## [55] 10122778443 4333824029 3283326674 112849413 6385975697 7975956018 ## [61] 210204075 144513355 145118575 102257259 162397218 424754069 ## [67] 278291541 175812288 138974871 258559234 412385494 246642948 ## [73] 447240937 317315791 755656427 354432319 466560197 244100322 ## [79] 214221442 184422278 336670907 59209638 79588059 106276706 ## [85] 172477093 468135485 283853034 204126728 232219565 2950195157 ## [91] 703903982 832269572 436237078 6970056180 614090663 201415848 ## [97] 544469250 238375984 550503547 230810950 241653749 114996036 ## [103] 102453209 127269592 131050389 98022999 136597611 160116397 ## [109] 208693101 72147288 162435042 313730881 667098008 404328975 ## [115] 605968535 451077270 524062466 4747798919 1728598186 12776321776 ## [121] 648117269 4706652226 4718665995 743726578 4967043891 2033955496 ## [127] 953096770 462893878 1403369302 5320660807 2842965457 2531222550 ## [133] 4218803604 171732132 206956593 521665804 1403310114 583520262 ## [139] 846378092 1023316734 238773253 1065648936 406103613 2322255189 ## [145] 2138129053 827106302 1532912840 984833268 2982478928 3204243797 ## [151] 2911286617 6067583799 4127141044 5213257915 1380645852 24170451659 ## [157] 9324325947 40563862935 2054020059 1586747787 506859062 816128223 ## [163] 1080124761 832098507 244156864 659527817 837760564 390486757 ## [169] 62125073 256749205 266515607 352119305 1229529845 221194951 ## [175] 207480837 295539506 385633939 21139328 42980834 107890825 ## [181] 55415180 15845364 25253613 604369524 239467145 293229726 ## [187] 289060069 409758026 464802431 236747687 26850519 28881788 ## [193] 8249195 86236564 5451808 17635838 9785023 8870678 ## [199] 136860370 13346547 209761656 12060332 2913663 48224035 ## [205] 7227424 16949384 76175203 372529234 1265891267 614397732 ## [211] 522111537 504309687 1729120049 169208563 129569919 762443067 ## [217] 1029316683 410105633 469565652 477456361 374509844 587145423 ## [223] 390983403 543513338 317978589 2564838662 1597337437 2735609105 ## [229] 5405516974 5474649580 294529545 254833758 171146919 180698278 ## [235] 836850073 649976193 783296703 471122840 540020247 1822166987 ## [241] 460043516 179153483 170044299 358075802 360099927 10086081038 ## [247] 8486932972 2480753161 609977106 1294428804 404900705 682585279 ## [253] 309704683 212174869 2831552868 4055299785 9502547335 854404452 ## [259] 13666458111 9735533913 15991415045 511815699 266679475 441351892 ## [265] 1216812569 629446065 656652292 370243327 310664395 356646225 ## [271] 153279778 9812620733 6635872349 8055607462 14674269045 7443786454 ## [277] 14171528648 3210439823 504411830 359649459 705495272 778864989 ## [283] 660748817 434790306 90172006 185242030 83401459 112023107 ## [289] 89915250 4765892026 7580651248 4276077995 10436807892 21670846083 ## [295] 8159865665 4131343258 1475529162 1481647512 2161012742 303805970 ``` --- # Operations similar to dataframes Create new dataset that captures locations for one administrative region ```r city_sf <- country_sf %>% filter(NAME_1 == "Nairobi") ``` --- # Operations similar to dataframes Plot the dataframe ```r ggplot() + geom_sf(data = city_sf) ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-12-1.png" width="65%" style="display: block; margin: auto;" /> --- # Load and explore polyline .exercise[ **Exercise:** * Load the roads data `roads.geojson` and name the object `roads_sf` * Look at the first few observations * Check the coordinate reference system * Map the polyline ] -- .solution[ **Solution**: ```r roads_sf <- st_read(here("DataWork", "DataSets", "Final", "roads.geojson")) head(roads_sf) st_crs(roads_sf) ggplot() + geom_sf(data = roads_sf) ``` ] --- # Load and explore polyline ```r roads_sf <- st_read(here("DataWork", "DataSets", "Final", "roads.geojson")) ``` ``` ## Reading layer `roads' from data source ## `/Users/robmarty/Documents/Github/dime-r-training/DataWork/DataSets/Final/roads.geojson' ## using driver `GeoJSON' ## Simple feature collection with 3326 features and 3 fields ## Geometry type: MULTILINESTRING ## Dimension: XY ## Bounding box: xmin: 36.68034 ymin: -1.430759 xmax: 37.07664 ymax: -1.162558 ## Geodetic CRS: WGS 84 ``` ```r ggplot() + geom_sf(data = roads_sf) ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-14-1.png" style="display: block; margin: auto;" /> --- # Load and explore polyline .exercise[ **Exercise:** Determine length of each line (hint: use `st_length`) ]
−
+
01
:
00
-- .solution[ **Solution**: ```r st_length(roads_sf) ``` ``` ## Units: [m] ## [1] 901.5756687 137.8591461 166.0896978 24.2633581 174.3557406 ## [6] 482.5503262 486.2506610 64.1042587 615.4574212 16.7135334 ## [11] 19.6987155 3.8487318 4.1237787 555.4454885 551.5809255 ## [16] 7.0648280 229.5654887 588.9304516 136.9445835 579.1322038 ## [21] 58.3317564 21.7936436 90.1570913 41.2507165 81.7085529 ## [26] 68.3241690 496.3577265 14.1516418 44.0357348 45.8100172 ## [31] 41.6768610 35.1260485 40.5775920 43.1833377 1068.7247201 ## [36] 254.9862449 554.1882417 280.0103135 573.6525111 632.2063080 ## [41] 903.4320724 15.2156667 84.9916400 89.5853644 39.3628302 ## [46] 656.4399014 562.9941828 53.0465233 55.0490837 22.1513814 ## [51] 157.2766915 742.1361789 255.6841254 188.6658952 196.8677316 ## [56] 322.5741540 136.8794494 145.1362286 1123.8795488 449.7621126 ## [61] 76.8128399 425.6253062 83.2814112 67.4804517 68.9621063 ## [66] 537.9933283 19.3785758 103.2281926 59.2140086 26.1598809 ## [71] 384.1848387 349.0812756 23.3985081 34.3301226 28.6400611 ## [76] 22.0905033 126.4963080 638.0499026 1026.0440086 19.1969292 ## [81] 259.8950720 372.2373513 42.3194440 456.9002342 87.6125554 ## [86] 1531.3978557 271.1715579 325.2722605 236.2997117 10.4403690 ## [91] 92.4952213 379.5306443 7.9499993 622.4095718 15.1095253 ## [96] 142.7377124 107.0817825 33.4670806 62.3776056 724.0008290 ## [101] 695.5812951 65.0141534 179.2608490 195.8997251 100.9949995 ## [106] 316.1494227 86.9340451 70.4163898 17.3534405 66.1852333 ## [111] 214.3044443 36.9411214 83.7928519 78.3060108 69.4968528 ## [116] 33.7206292 353.4594169 82.6056373 88.7926213 38.4544995 ## [121] 76.8962357 393.3685982 75.5649428 102.8354677 354.3536206 ## [126] 474.7705086 15.2113293 103.3297854 89.7521140 329.2709418 ## [131] 77.7469296 40.6313552 895.6172572 20.2117719 76.1289428 ## [136] 24.1060651 18.3469648 16.0958072 81.8447065 65.8406025 ## [141] 7.5231536 15.7374155 18.3466472 19.3446878 44.4684396 ## [146] 2365.8500168 446.3683496 10.6850690 29.7175135 242.1259984 ## [151] 26.2144241 31.1617679 28.8825801 209.7441656 15.9135722 ## [156] 45.3474360 42.5618716 91.7284428 86.5929193 76.5162668 ## [161] 1266.1912709 190.9966548 624.1573841 144.6972973 9.8356699 ## [166] 196.1921943 192.1871700 461.4516033 75.0112908 79.2532691 ## [171] 143.6958205 145.7748597 21.8978461 28.1025463 112.6922458 ## [176] 152.6120694 112.5493237 144.9337639 132.0369035 209.2480993 ## [181] 79.3796577 64.9486671 387.0803172 215.5175441 12.6478446 ## [186] 168.7727630 157.6313106 294.6233761 18.1854094 18.8625601 ## [191] 13.7368582 151.9507789 192.6065070 171.5378849 170.0515123 ## [196] 69.4623510 125.1809792 58.0674866 27.2447119 32.5741136 ## [201] 35.8842400 64.8745572 85.9424283 83.7723887 64.4053412 ## [206] 62.8530651 65.0171112 64.5664656 178.9742969 217.9866447 ## [211] 489.5666134 13.2762654 104.7828459 156.2478096 621.9029790 ## [216] 43.3600731 302.5106465 41.5279621 24.6797711 21.7347254 ## [221] 23.8105466 21.5264513 70.2397622 9.4377603 10.0938680 ## [226] 66.0249901 244.1331322 28.6839859 28.7873155 33.1108802 ## [231] 33.3351163 24.8852604 23.6230870 8.8595469 11.4747578 ## [236] 36.8462913 34.0463826 9.7580548 9.5823967 59.6958745 ## [241] 61.8846061 23.8303712 28.6172501 91.6315235 35.8453316 ## [246] 26.7214118 94.2759598 23.9169331 28.8016559 14.7121456 ## [251] 160.0461962 24.9814001 234.1473151 233.9271025 1087.4033542 ## [256] 30.7029040 107.7901906 11.0186406 294.0182362 78.9769053 ## [261] 326.3768128 22.2702098 13.2364839 1383.5215721 1898.0605181 ## [266] 72.6186507 7.5804008 3.1026573 430.7113218 9.2086618 ## [271] 3.9108514 170.7630992 9.0954080 48.7723173 1481.7397216 ## [276] 41.1797019 11.2299044 1150.7185295 11.7465339 5.7100755 ## [281] 11.4443180 23.9962223 257.6137864 424.0299544 504.2196062 ## [286] 290.7286084 819.7619364 180.4740231 299.5438255 327.8963904 ## [291] 192.1903662 1405.1906820 266.1970438 586.3471885 249.6224346 ## [296] 386.0873600 294.4671050 262.7601875 312.5095825 347.5224103 ## [301] 159.9247379 156.4216476 97.6085897 532.2538261 1333.3107097 ## [306] 39.7639008 38.7905208 303.5138114 105.4574924 107.0132551 ## [311] 154.3195781 1944.9035576 145.0378429 120.0534867 119.5947935 ## [316] 385.3657995 389.8012058 237.6396595 392.8319275 584.3152477 ## [321] 345.2304860 258.5297320 348.5017232 49.0834418 252.3630361 ## [326] 46.6053718 53.7971157 16.5030812 8.5162124 2.8579087 ## [331] 20.9184780 4.4349335 17.7782755 7.2393990 25.1908173 ## [336] 122.3792075 12.7308440 19.0640907 20.7117666 22.3675469 ## [341] 9.6071254 6.1573112 17.5754389 11.3573512 9.7721919 ## [346] 5.1558705 7.6936823 94.7484823 65.2294593 17.2512599 ## [351] 35.3221753 82.5468970 24.7475964 15.8508481 3.1924434 ## [356] 16.5851770 13.8120335 8.0474435 41.9378167 19.3576011 ## [361] 17.7580834 22.2949597 191.5661744 634.5075201 816.8811538 ## [366] 655.2839822 103.1479667 180.4383570 97.8573929 160.9810606 ## [371] 30.2577084 39.3902894 38.8495788 19.9979687 33.7015108 ## [376] 79.9729520 954.0892209 282.0343255 464.7152700 6.4780237 ## [381] 5.3552633 31.7752483 77.9255241 9.6696887 142.6158662 ## [386] 36.9473101 8.8191449 6.8877796 70.1666679 47.0089317 ## [391] 34.9262862 258.3085289 25.4844318 321.2387063 19.1271656 ## [396] 118.5167927 548.5500379 486.6529610 15.1975154 11.5147942 ## [401] 15.3145086 34.1347041 133.5946100 1.7055420 4.7526408 ## [406] 10.3050550 25.0975782 10.8495140 36.9968307 22.5281982 ## [411] 355.0953618 170.2955793 148.7003402 69.4643558 409.3216092 ## [416] 26.0156314 21.0625056 46.0301592 31.3051782 21.7771179 ## [421] 109.7707056 151.3782309 99.5965917 13.4915459 18.4022673 ## [426] 33.3176239 139.7552481 48.1512890 33.6294826 22.1860829 ## [431] 20.9406017 57.9664126 47.1977385 46.3091697 60.8139933 ## [436] 30.8717481 27.8069136 783.3000240 72.5300215 387.5362643 ## [441] 97.8461769 95.2513024 3457.1823444 595.5409619 1619.5937105 ## [446] 5584.8872802 1499.1952190 2028.4565142 680.7133978 1302.3363313 ## [451] 678.6513017 36.6824783 42.0162274 823.7448654 180.0230638 ## [456] 1181.0184045 2737.4285597 94.3951178 13.2461914 783.5823522 ## [461] 368.1835639 584.4490514 2722.6266678 202.1794000 63.2123218 ## [466] 55.4494003 226.7181235 67.9559950 132.9270414 41.8715331 ## [471] 182.2826166 40.8030270 45.0280380 44.3298323 120.6495980 ## [476] 13.4712081 1145.9943087 5.0921307 24.7134355 439.2708675 ## [481] 24.3353555 115.6018459 81.1807423 53.4532517 196.1336754 ## [486] 599.9176991 10.1199568 11.4654268 14.9786963 79.6391412 ## [491] 69.2044451 100.4573969 27.7558417 34.5871766 43.9760462 ## [496] 97.9293842 11.5960060 138.8058831 42.8929421 146.1023034 ## [501] 139.6758627 415.2691874 38.9242704 21.7098998 3.5691979 ## [506] 1497.8938544 167.6807577 20.3186424 32.9509179 54.2660145 ## [511] 11.1966993 137.9221967 631.2756409 16.8851408 7.7234045 ## [516] 350.5003626 530.1595922 28.9381369 590.2058248 24.1364902 ## [521] 139.5541730 131.9743994 109.8851745 419.1730043 170.6410994 ## [526] 35.0813611 68.3361618 55.8897003 120.6205357 63.6029748 ## [531] 215.6329014 37.4591260 40.1937053 40.8196565 16.9595112 ## [536] 15.5474023 22.2502999 315.1573385 958.8323950 191.1863948 ## [541] 1099.3752603 1317.3012394 778.0268477 1181.2295208 133.8797784 ## [546] 25.8751071 225.9435679 554.4391915 993.2147501 308.3557023 ## [551] 985.5637702 903.3176817 358.8597559 207.6755842 55.2310760 ## [556] 973.6106624 519.2064966 103.6670802 312.0635612 159.9679588 ## [561] 181.0864365 22.9457952 366.2705538 151.8901725 528.3560148 ## [566] 25.5462369 210.4253921 1338.6268608 146.2273234 1175.9188413 ## [571] 218.0130213 429.0333904 1784.3785883 551.0370785 916.0289656 ## [576] 172.9387415 675.3175058 40.3510194 44.9512866 327.0125488 ## [581] 5.6398865 61.8782965 764.5484371 58.1481312 17.5581318 ## [586] 216.8610192 285.6813129 819.2213509 333.4904689 33.0692048 ## [591] 235.8484256 65.4300701 472.3538731 1652.3342559 563.5092699 ## [596] 1833.5140556 36.3021440 29.2691943 28.6855231 302.1278156 ## [601] 184.1285902 428.9435998 110.4304191 109.5976082 2.4958180 ## [606] 409.3183936 45.7204145 38.3597101 50.7490659 53.4398938 ## [611] 743.4143329 38.2913228 56.7994642 444.9803442 465.9524181 ## [616] 34.5027896 291.5740322 389.8249641 375.0376426 409.8520866 ## [621] 75.8337783 525.5417411 1312.0854546 84.7627779 84.8821432 ## [626] 369.5174351 575.9314069 388.2071236 511.1662966 92.7640086 ## [631] 91.5328540 78.8301588 49.0392982 33.9980935 35.5622342 ## [636] 27.7700008 27.9005398 29.0209834 30.9235092 33.9850888 ## [641] 32.2278183 584.2536324 300.1825187 884.4785562 32.7260311 ## [646] 82.0667462 87.5934113 35.0565463 66.6211029 37.6437236 ## [651] 184.7359928 244.4021735 438.6916772 12.9440880 159.9323141 ## [656] 1077.3894213 146.4321278 46.6048835 830.5416260 8.6145019 ## [661] 236.7705825 324.7401320 941.2589821 65.1393942 21.0998685 ## [666] 156.6775181 1.1355472 8.2803498 20.2807930 149.4934972 ## [671] 395.4971305 1246.8499189 150.6995593 344.4626073 924.7841988 ## [676] 1560.0825516 144.3620087 22.2393904 599.4581211 61.8062144 ## [681] 477.7193559 228.6969497 1647.2569314 171.4025942 26.4446096 ## [686] 81.6183151 29.0357380 30.1200693 528.4314343 180.8634656 ## [691] 1015.8428274 67.5746491 14.7702472 5279.1893241 84.2060075 ## [696] 709.7803163 27.7404110 23.6877441 124.8206540 45.1023934 ## [701] 1096.4055176 439.4130442 285.1643153 85.8517768 163.5811137 ## [706] 56.7707780 494.3124745 496.9553384 620.5132674 271.7436730 ## [711] 395.4382764 60.1724267 823.8076371 819.3525142 306.1667636 ## [716] 395.6030399 529.4408750 124.5389417 528.0539679 122.8169968 ## [721] 373.6494220 383.2892532 85.1511758 138.0072834 33.3539334 ## [726] 334.8612855 293.3640997 118.1859241 158.1454858 74.3946246 ## [731] 73.7371095 465.3188537 1832.0767213 1833.4009563 218.2302033 ## [736] 62.2544037 3.4956126 87.1684795 124.8208663 86.8189481 ## [741] 5488.3057753 123.9509501 14.2883315 1666.9139734 748.0903054 ## [746] 49.9634281 190.2779394 7.5261024 45.8158791 7.5386555 ## [751] 57.7165324 517.0635715 408.0456955 82.1358503 100.0969158 ## [756] 872.2724215 1279.2869599 221.3470347 245.2947901 35.3498697 ## [761] 35.0142544 172.3230676 89.7822747 404.7602408 48.5616936 ## [766] 260.6199182 186.9671588 147.5184832 152.7140635 674.2905308 ## [771] 100.4740449 179.9231641 238.2048098 614.0797907 488.9053938 ## [776] 57.8612955 566.3852712 1117.8686336 44.4986380 69.9133629 ## [781] 55.3010451 250.7707760 36.4569135 247.1546071 86.4520588 ## [786] 13.0481952 5.1659345 304.1410379 27.4410913 22.5853339 ## [791] 37.6888448 19.8599542 272.5411795 20.1977281 196.6851579 ## [796] 54.4960236 28.1627084 21.6955818 402.4280107 4.8244282 ## [801] 9.1129976 15.5344555 63.4480485 5.8812957 123.0862703 ## [806] 29.1183288 125.5342124 1.5055405 59.4158863 157.2353335 ## [811] 466.3438615 963.9619406 386.1960804 452.8253543 244.7651312 ## [816] 20.1482959 78.1276469 49.4407502 137.2633562 96.8803066 ## [821] 1207.1054027 743.1898773 205.8291731 59.8232354 294.2870876 ## [826] 101.8979306 119.5490138 47.3416426 107.8143991 66.5801608 ## [831] 97.1375090 43.9224715 973.6075927 39.2927996 83.7180186 ## [836] 146.5891497 87.1174296 974.3463455 141.8936755 43.2863648 ## [841] 14.4161368 49.6843044 52.1822676 29.8933487 41.1186099 ## [846] 68.9970683 6.8823138 4.4776788 324.5445792 233.7617235 ## [851] 568.5674685 749.3980775 228.1678298 98.6563597 40.5827242 ## [856] 216.3827828 70.0473245 217.2842037 90.9853896 21.2981957 ## [861] 24.0885726 1040.1255211 105.2028763 8.3703545 72.5158641 ## [866] 73.2902518 1797.4844403 165.3271952 80.5939021 1061.5132934 ## [871] 80.5800527 117.8535543 188.1928750 116.1058833 81.9826745 ## [876] 119.7373509 54.0323515 54.4318895 35.3899552 182.3065926 ## [881] 19.6241296 36.3407694 41.2927010 1277.9595941 57.1802214 ## [886] 1695.7872061 67.5694833 970.4559760 474.3823150 59.2730034 ## [891] 379.1039421 26.9048509 59.5719638 253.4309173 1230.0072675 ## [896] 531.8979227 332.0872155 133.2998290 224.8303164 29.1136860 ## [901] 29.6906890 978.8324523 162.5717150 66.4655964 272.5905298 ## [906] 10.1284245 28.3997185 39.7911930 40.8911659 48.9927633 ## [911] 15.7479493 19.6800536 6.4006539 19.5146830 117.4625388 ## [916] 185.2823614 1566.3169811 530.1298011 1469.4628397 394.1681792 ## [921] 1391.0489685 636.0125284 614.8276895 189.7447103 194.2597716 ## [926] 194.6888372 412.9811285 1229.3552203 89.2320681 1206.8321940 ## [931] 95.8399103 426.7015632 95.9764462 431.9149615 93.7238781 ## [936] 31.4790959 1991.2871510 1843.1687385 303.0358062 11.7094360 ## [941] 352.7983944 54.9449183 54.8837162 43.6491986 169.8902408 ## [946] 182.9733973 1163.1268768 68.3010290 3.5742129 609.4309914 ## [951] 952.8246090 1025.5924836 76.0704670 79.9118804 106.2573504 ## [956] 47.9876131 200.5658014 4.2554540 15.4300388 23.5500736 ## [961] 19.6214931 19.6296854 99.5588355 1862.1189828 573.0156594 ## [966] 491.5807566 59.2157293 1054.2046285 107.4783465 431.7556436 ## [971] 261.8638453 1046.5175495 380.5346308 366.5924850 36.1046936 ## [976] 81.3312350 53.6732631 27.8975984 401.4209926 303.2084438 ## [981] 614.2689277 164.1128135 41.8078866 43.8584412 32.0244350 ## [986] 32.3165863 97.2718237 102.8370313 321.6684214 32.5644679 ## [991] 50.2540603 30.6764545 56.1691366 17.7414032 175.9406585 ## [996] 394.3496263 285.8372588 43.2231697 33.3231928 146.9037271 ## [1001] 47.7502424 86.4950096 186.4147154 127.1780857 80.0323882 ## [1006] 155.7473175 510.5864700 184.9006679 41.3202117 47.8587415 ## [1011] 254.8328508 45.8534514 737.7600356 496.7690741 233.5524160 ## [1016] 978.4249081 815.9885541 286.7731620 366.5658167 36.6514280 ## [1021] 168.7670616 290.8013527 713.8193635 12.5005177 225.0977695 ## [1026] 490.9162144 56.2934800 1265.6855608 39.9399856 488.8743869 ## [1031] 971.7412386 234.8484276 56.4091621 478.3040426 9.1089264 ## [1036] 154.9279373 84.2356512 10.4062621 14.8192665 459.3404606 ## [1041] 516.1828352 16.0938447 536.5396394 5.3172995 4.7739700 ## [1046] 235.1981972 37.4448424 12.8655046 519.0100044 22.6282105 ## [1051] 14.1441437 395.0783184 497.1933347 85.4897657 10.5692039 ## [1056] 233.7556208 147.9017451 5.8650871 86.6578607 36.9154242 ## [1061] 890.9953547 240.3075989 197.9057550 242.4540281 258.3034770 ## [1066] 788.0737489 17.9110912 29.9806563 179.1641082 150.2295531 ## [1071] 247.6663378 24.9277111 67.4181783 47.4256397 367.4909453 ## [1076] 7.8346117 675.3190009 115.4689410 240.6016464 420.4477729 ## [1081] 240.0145076 364.6371243 4.3366782 68.3174618 115.4192360 ## [1086] 10.8923913 50.7996179 9.0025076 276.0982380 164.4654917 ## [1091] 438.7231881 163.0882953 341.9873905 228.9134242 417.3109344 ## [1096] 557.0800665 117.8580434 114.5938709 416.1329211 184.7106110 ## [1101] 650.1043970 440.1988259 7.9683128 1041.1927031 947.9051380 ## [1106] 948.6217438 86.7252242 143.3583697 431.0539657 765.9085275 ## [1111] 113.2007200 370.6136911 441.0370940 579.0925782 128.1143109 ## [1116] 226.5677121 675.7653651 1018.3729933 288.0621275 21.4581879 ## [1121] 129.0152963 17.3582527 35.5342163 511.7011808 97.7990916 ## [1126] 432.4023417 42.1950574 58.5874220 59.5634992 22.3873847 ## [1131] 46.6209955 545.2577329 778.1061548 31.2955353 40.3636353 ## [1136] 143.1781208 142.7792434 264.2711981 263.5249798 1313.3235466 ## [1141] 30.3158130 21.3895427 32.1887201 11.4364760 31.0101026 ## [1146] 33.2525100 13.6536252 12.5635128 37.8175363 857.4770316 ## [1151] 19.8346133 9.7365330 383.6681883 69.0253382 66.5074625 ## [1156] 70.7630881 418.3929798 10.3259854 13.6779314 21.8085353 ## [1161] 7.0441086 283.1560757 493.0552083 196.3229621 13.8174528 ## [1166] 8.4750261 28.8304230 491.2983478 5.1231080 11.4820632 ## [1171] 8.9340340 6.6209320 130.5428129 122.0598075 1172.5355918 ## [1176] 73.8142244 20.5287218 776.7623757 29.8388567 46.3625503 ## [1181] 410.0169437 411.1949787 44.9555870 9.1916845 372.7872695 ## [1186] 2660.3801053 548.4065226 138.0607216 2178.0303821 315.9404291 ## [1191] 9038.6737236 20.4347681 872.7258897 2547.0633669 38.3220695 ## [1196] 17.2471829 150.0674648 56.7405805 1862.4397868 37.3618121 ## [1201] 21.6992661 43.4890286 54.7357646 1533.0652501 2207.8230699 ## [1206] 2448.5449998 2756.8498528 214.8013834 2480.3539856 560.8206755 ## [1211] 1457.3798420 2040.3093456 218.2911843 232.4549753 8.2005740 ## [1216] 101.5729901 88.2197020 415.8806954 526.1996498 145.1688690 ## [1221] 128.0387822 130.2778383 160.4008095 229.5439387 221.1795006 ## [1226] 58.7056748 111.4956485 16.4510897 290.1350725 358.6708235 ## [1231] 20.4815589 45.0710628 2232.6848928 46.6876688 12.7251580 ## [1236] 79.7737624 167.1678433 43.3238353 46.9324923 42.9532340 ## [1241] 25.4693633 17.8627174 170.3340425 88.7619722 241.6842378 ## [1246] 25.9585702 27.1217939 913.6155362 371.7571757 132.3408665 ## [1251] 297.1020994 40.5773925 42.1219275 56.8946948 608.5373480 ## [1256] 701.9232630 1042.9682871 480.7055399 317.0747212 37.8210118 ## [1261] 156.6589543 141.8214147 7.6429969 6.4126673 7.7091308 ## [1266] 145.5451076 13.5435379 4.5012922 9.1718341 40.0139968 ## [1271] 11.2263379 16.6926724 37.7382773 147.8065895 171.7821215 ## [1276] 57.1094316 1797.5929312 2239.3247225 50.0337709 44.1990354 ## [1281] 262.0228852 265.0428967 176.0812852 1768.3226365 197.3272544 ## [1286] 34.1582288 68.0651830 190.1839589 78.8242072 46.7535140 ## [1291] 38.5209939 104.6383526 37.1641041 107.7119782 176.2178048 ## [1296] 190.9436018 56.7281946 59.2459227 36.8532104 41.4663918 ## [1301] 11.6654587 14.0709706 44.6905891 78.4044959 263.3735493 ## [1306] 267.7627464 722.4983504 1499.7979239 67.5296604 951.0659148 ## [1311] 61.1561942 228.6322552 651.9290938 282.3240831 269.7825458 ## [1316] 41.7299866 4527.4678514 263.7276327 544.4658602 105.6522815 ## [1321] 49.6457551 1449.5949139 34.7643954 215.9324393 5.6286071 ## [1326] 65.0959147 246.9843706 955.4922605 17.0207004 27.1726774 ## [1331] 191.3851680 12.0276862 431.4363332 30.4135827 46.9871143 ## [1336] 53.3495909 242.5486819 236.2073737 76.9584917 94.9348962 ## [1341] 581.3692611 45.0892711 41.7945867 241.2274470 6.7255916 ## [1346] 233.9583881 382.9237058 1466.8756082 369.7265569 114.7002884 ## [1351] 170.0208517 259.9704289 204.2499935 264.2749557 268.9516618 ## [1356] 45.8369296 228.9577961 45.2448470 475.8699399 229.0296460 ## [1361] 114.4448502 244.1300982 359.9170882 8.4677891 1589.6472527 ## [1366] 104.9394581 258.2214049 896.8706261 436.8960733 44.1994663 ## [1371] 44.4477377 292.0356889 275.9140480 441.1210301 709.1323010 ## [1376] 27.4152832 115.8027884 44.7846185 63.8456461 83.8115655 ## [1381] 44.7676133 70.9473638 81.7789696 539.7762154 69.1539751 ## [1386] 294.5902917 60.0061073 111.3081073 209.9107028 316.8380348 ## [1391] 65.7412681 260.4766455 419.5478631 864.3034798 648.4630525 ## [1396] 139.2195485 60.0023218 671.8877802 153.2770603 62.8507770 ## [1401] 149.4780994 50.4297987 270.4354467 112.3871587 60.9119095 ## [1406] 49.7022579 28.4706853 49.2706599 21.2883411 26.1404629 ## [1411] 681.5798974 22.7483391 230.5689532 51.8512173 147.9485670 ## [1416] 93.0148889 272.9696405 12.9694229 453.6468089 115.8965784 ## [1421] 110.6281513 88.9713007 474.1295490 1063.7363679 33.4018211 ## [1426] 554.2050553 910.8745786 406.8559520 40.1587748 96.3585332 ## [1431] 29.6981801 402.1320426 49.5338979 51.8050157 30.0262289 ## [1436] 348.8135685 432.0155908 367.9701509 59.9799298 17.4908119 ## [1441] 24.2123953 8.6509908 21.9470608 271.9536841 227.4029478 ## [1446] 32.9466317 30.8367464 14.1117384 42.8240962 46.4446976 ## [1451] 42.8634635 11.6399816 87.4930887 93.7175205 11.3616057 ## [1456] 166.3861169 292.6115595 51.1438210 123.3331809 12.1679547 ## [1461] 57.8021116 30.3156861 24.5582569 6.9189167 598.3151784 ## [1466] 53.9033103 53.8427186 11.2794780 233.4022375 63.6940233 ## [1471] 47.0879970 105.0891177 21.1924306 342.7412232 591.7123343 ## [1476] 99.4809081 881.3979119 522.8566821 20.7585642 487.3785509 ## [1481] 114.4642781 192.6391078 286.6574670 158.9564833 1097.6414973 ## [1486] 31.8979451 35.4021448 336.7253862 367.2433800 64.6868899 ## [1491] 13.4825622 201.2127943 177.4373666 30.5992806 33.5185638 ## [1496] 352.4605715 15.3327049 9.3225818 11.1828548 20.0756911 ## [1501] 710.2387979 21.5360282 34.7137819 20.6578778 20.3542527 ## [1506] 26.8699628 26.0137640 26.5628425 163.6119941 110.4090929 ## [1511] 17.2359606 15.1925028 351.1412960 15.0610111 290.4881972 ## [1516] 39.2683340 49.0361824 10.6785412 12.6456315 11.7563795 ## [1521] 11.7534255 1026.8286643 53.0923684 41.4815741 4.0590828 ## [1526] 19.2154071 821.9837751 882.0484702 305.8303613 86.7839228 ## [1531] 120.2365160 8.2259904 124.5938487 151.6869947 70.6355517 ## [1536] 124.1318906 8.8388611 14.7113740 4.0746793 41.9399003 ## [1541] 62.4405848 104.1200681 22.1436824 212.0248336 1.9006257 ## [1546] 10.3540863 207.9761666 53.8443465 53.5683382 18.6808744 ## [1551] 60.5070273 122.5637728 41.1772959 26.9166378 70.4707775 ## [1556] 99.2340599 97.7481651 25.7376512 26.1532731 46.4252393 ## [1561] 46.7796250 74.7682644 33.1874962 46.8717351 31.9114742 ## [1566] 35.1586279 34.0598684 243.9581000 9.7556266 266.5249064 ## [1571] 9.8013935 340.1405923 225.5430311 135.2110464 380.4270533 ## [1576] 5.3957392 73.0885814 12.9639494 12.2893776 98.0867565 ## [1581] 14.5407678 360.9990417 47.1935880 19.0442043 215.8602205 ## [1586] 366.1686145 11.8574834 21.3706823 20.4316149 516.4895129 ## [1591] 894.3159314 12.1834730 140.1126955 126.6082637 245.3386811 ## [1596] 346.6368031 100.7498666 28.3512069 15.9594622 11.4815220 ## [1601] 202.7184450 420.4145737 73.7502671 60.1682920 75.2245592 ## [1606] 25.6147530 56.7426412 200.6090830 448.2411008 212.7515110 ## [1611] 322.4076256 521.2659579 12.3518022 122.3600829 321.6467093 ## [1616] 8.2396311 32.7941078 90.3411892 19.6886499 361.3597967 ## [1621] 43.2064750 63.4049365 39.8341655 144.6618597 85.4889575 ## [1626] 348.1891465 2048.5061256 26.4776000 538.1885916 455.7517147 ## [1631] 783.5660876 124.1075189 571.1421735 570.7759200 705.2480417 ## [1636] 720.4545218 164.9623513 45.4931714 879.2890391 44.7644418 ## [1641] 2220.6508523 845.2949489 2.6897170 740.2516984 17.4547881 ## [1646] 14.7696625 263.4000917 4.5701035 1833.1208111 304.9681254 ## [1651] 10.9501795 711.1008717 9.9519372 153.0440394 1292.0582915 ## [1656] 54.6152617 984.3980499 1145.1931586 262.3057107 657.3750687 ## [1661] 17.3508511 23.4054130 98.1109887 1210.0241725 82.0159281 ## [1666] 6744.5573000 845.3858175 3727.8114991 23.3125307 8.8487986 ## [1671] 506.5281367 123.1840974 175.9522484 6459.2061019 278.6591376 ## [1676] 291.1063312 6750.3879376 2899.0080462 1252.0584752 113.5618008 ## [1681] 1132.2030455 82.8369884 89.4270816 99.3788546 266.1269090 ## [1686] 108.6498768 198.5368018 455.7977846 283.1227752 59.0212042 ## [1691] 40.1371712 2662.2268164 1536.7801697 336.7226786 906.2821646 ## [1696] 76.0911538 54.6974379 341.2895697 19.5973752 109.2432438 ## [1701] 392.3281154 1159.8308400 470.4625101 387.0584321 254.6761696 ## [1706] 256.4307135 398.0505212 63.5788153 49.6191688 944.9567820 ## [1711] 233.6577864 255.0985846 298.0344584 419.8330736 15.5122487 ## [1716] 57.8039074 506.5156019 243.8234349 399.9221459 447.3162406 ## [1721] 361.5127358 351.4389799 483.1581444 1087.3291601 435.1098919 ## [1726] 1713.9706898 10.9175736 5.9844791 60.5793772 26.2788084 ## [1731] 264.9590080 242.3527392 349.5563766 278.1607521 402.9018762 ## [1736] 1176.3133249 21.1914749 2.9921983 19.0371016 30.6100424 ## [1741] 42.1768586 41.9220442 73.1682054 104.9931281 4854.6366255 ## [1746] 32.2181020 21.2483587 114.5106423 9.8492114 29.5041429 ## [1751] 226.3716812 506.3697759 65.8017344 41.3533678 64.3841845 ## [1756] 468.8642805 26.3670204 11.8700828 40.6246727 19.8294460 ## [1761] 24.6489403 12.4305733 55.2190897 48.9707310 25.3014454 ## [1766] 30.4373957 147.4593172 211.7411848 17.5432961 2028.4582898 ## [1771] 16.4256713 8473.1507468 86.9308717 1708.9774330 85.3228870 ## [1776] 467.4098529 20.5861875 219.0593471 191.5752129 1411.1001740 ## [1781] 1637.5404795 395.3370845 23.4478496 51.5495546 13.8147219 ## [1786] 12.0006056 13.2702253 12.2609650 394.4219325 558.7327942 ## [1791] 12.9683746 560.0899157 9.5163059 4860.9174508 43.8472379 ## [1796] 24.7236382 39.8751958 3876.7879171 65.3696598 375.0862316 ## [1801] 3448.6373614 23.8195210 4594.0121264 3237.8286204 23.4939585 ## [1806] 4.0210378 23.2607973 25.9161953 485.4102497 289.2301502 ## [1811] 128.1369673 270.2858407 27.8358732 23.9434836 98.7312662 ## [1816] 976.5050899 210.6497032 61.9379358 808.2498706 955.6939032 ## [1821] 562.3038144 531.6644562 519.5530549 293.3488781 261.6134509 ## [1826] 421.0667174 217.1430293 496.3161124 165.9699343 418.3480845 ## [1831] 492.7980309 221.2166280 165.3099669 223.5793682 258.0278350 ## [1836] 318.0911300 270.9276712 285.0553465 796.5188318 464.7134514 ## [1841] 796.0054613 463.6886301 22.6463281 23.0981481 343.6275233 ## [1846] 342.8508791 26.5889718 1347.5169047 25.2855597 1337.5259681 ## [1851] 42.1460797 37.4540041 704.6800823 708.2592318 971.8168651 ## [1856] 20.5119621 243.4759454 156.9420951 9.1038656 9.1535926 ## [1861] 8.3348554 293.8144470 221.1379592 507.9803312 148.7131524 ## [1866] 19.2460675 7.1514511 57.1804764 24.8203224 50.0412735 ## [1871] 318.4796387 56.4756482 296.8119049 71.2396985 29.6078050 ## [1876] 44.2650165 225.3858906 140.9794796 334.9039324 64.2499480 ## [1881] 223.2852731 483.0954456 481.4773223 8.7642195 16.2870584 ## [1886] 57.4341037 59.3673051 8.4452966 116.1522803 742.2895814 ## [1891] 30.4681001 28.6863757 44.8367806 37.2653861 616.0111949 ## [1896] 247.9532637 18.6163147 95.0946080 92.4940541 721.4866712 ## [1901] 986.4195281 13.0985704 17.0916240 19.9589746 6.2137497 ## [1906] 227.7491962 3.4283414 97.0818934 26.1296510 16.2337757 ## [1911] 43.3077239 36.0357240 30.5689057 31.6710927 38.2845185 ## [1916] 257.2760208 2600.7773161 25.6408065 22.9531499 731.3014420 ## [1921] 292.6538059 47.8920096 53.2775514 227.2035454 598.7659934 ## [1926] 602.2333210 90.5690589 16.4347849 15.1699105 6.3754679 ## [1931] 109.8299775 184.0274233 339.3816037 609.9741934 5.7057687 ## [1936] 23.0718101 231.6790131 569.7665437 30.6515634 9.1630772 ## [1941] 95.5636674 21.0243886 170.4907627 13.6398496 19.4281770 ## [1946] 3.6141624 7.7790830 31.1417474 14.0828827 8.7938374 ## [1951] 8.3903666 35.9694080 22.0948463 668.4031629 290.8707375 ## [1956] 136.4998949 455.8831693 55.2082524 284.3253613 60.0088341 ## [1961] 252.4160604 218.4627069 6.9028902 178.6773829 162.9841615 ## [1966] 121.3807560 4.4778539 41.0669019 58.9159449 43.9034511 ## [1971] 181.4370682 214.4247484 503.1798870 33.2273267 201.1704089 ## [1976] 259.1716908 844.0865419 725.8079829 383.2254195 97.7018640 ## [1981] 220.1530802 29.4510489 691.3991675 60.1184541 276.5709651 ## [1986] 3192.1353782 129.0495537 208.3094240 602.1872849 988.6642051 ## [1991] 33.1623834 236.3904163 397.5505713 191.1598529 4.4789755 ## [1996] 507.0129536 58.1499872 701.8254011 627.0769590 479.7818659 ## [2001] 743.7830317 118.8634033 157.2412450 59.0151758 13.6683880 ## [2006] 514.8602885 20.6872312 21.9459401 46.0370548 46.8371545 ## [2011] 399.0351864 189.8967046 234.6481097 146.0216839 92.5226259 ## [2016] 158.7896692 129.5672426 9.7761967 306.7113285 64.6656047 ## [2021] 46.6554620 179.2152523 571.6347464 156.7295972 922.1261692 ## [2026] 282.5709561 314.5465358 324.6785394 156.2799174 864.1929508 ## [2031] 57.1048018 215.6753246 31.4384559 7.4763239 28.7854444 ## [2036] 6.6075039 172.6059310 49.0077032 21.6773193 288.3214727 ## [2041] 20.6981289 182.5162922 247.2652673 22.9238482 22.8833130 ## [2046] 213.8886897 16.3000004 17.3774614 19.3516627 17.3823126 ## [2051] 18.2445252 15.7830077 16.2046327 25.0911337 35.5901106 ## [2056] 39.5809731 31.1870498 295.1722115 30.6347327 83.9810506 ## [2061] 36.1595099 70.8512450 35.2318526 32.3564697 28.6456617 ## [2066] 2.1745491 194.8249014 111.8991278 32.4610202 17.0465934 ## [2071] 179.6561315 21.3045714 211.8795741 288.9702306 424.3735120 ## [2076] 779.3620356 51.7543376 485.9083135 278.0918241 379.5115884 ## [2081] 78.3016479 132.8069790 23.3727895 12.3751198 20.8875745 ## [2086] 346.5104272 55.0545055 508.3300665 24.5650152 479.7161248 ## [2091] 684.2176794 58.0152172 39.3843576 18.4654780 38.5412200 ## [2096] 50.9524781 8.7910407 552.5074117 24.0624934 2265.1712935 ## [2101] 150.2832775 1132.2923514 722.4047271 9.6814546 121.7836464 ## [2106] 48.9252349 131.1853330 156.1850375 145.0252422 36.0859121 ## [2111] 37.5954394 311.9061288 809.5850349 173.6485262 35.4525110 ## [2116] 322.5553946 441.7068896 143.4953976 72.6010381 85.9582576 ## [2121] 164.3294262 48.1131321 21.3903254 241.9843114 6.4640985 ## [2126] 152.3502210 146.8390853 84.7571778 174.9925803 123.4777543 ## [2131] 243.8754405 119.5951112 92.0127090 18.1256961 217.2614854 ## [2136] 5.4562116 132.2304551 19.6363027 339.2358526 141.6598634 ## [2141] 258.3169295 128.4351947 116.8798059 668.8851020 133.9260773 ## [2146] 203.6654144 1106.6861048 100.7657672 103.9778447 53.6647334 ## [2151] 48.4975769 101.5054920 112.9651934 219.4814012 157.3068820 ## [2156] 193.2179597 79.3675986 176.1843786 126.4828793 90.9629294 ## [2161] 1104.7690054 15.8060286 183.9841561 16.2159128 1029.7768650 ## [2166] 15.8589895 179.3372235 56.8138832 15.2096989 11.4078238 ## [2171] 213.1589131 49.5877913 141.4076384 69.1711064 30.9488239 ## [2176] 218.5615388 8.0719715 166.2466427 142.6730872 467.0648770 ## [2181] 332.0443616 732.5304591 76.0700730 1610.2947251 298.7324384 ## [2186] 1566.8678707 603.5649762 1694.7742246 3059.8471447 555.4091280 ## [2191] 645.8024300 1342.3167492 278.7764200 56.1305765 57.4794733 ## [2196] 806.5933420 661.8451972 37.8040294 58.8439291 62.1988158 ## [2201] 2857.6397922 1526.7185716 54.4084420 81.9042144 20.3273853 ## [2206] 22.3137490 2387.8748655 5.4016044 1322.0227139 29.5181789 ## [2211] 30.9945154 41.1343432 42.6141149 26.4878228 27.4670398 ## [2216] 123.6251863 26.8588054 932.6836906 179.4373586 1261.2760277 ## [2221] 263.7392255 517.2999044 2656.2374989 199.5827542 27.1715613 ## [2226] 29.9215700 29.4592199 28.3712538 30.2537791 19.1072806 ## [2231] 21.2191001 13.6416955 393.0118148 11.8042913 76.4400863 ## [2236] 87.1203411 417.5490710 235.1579765 15.0506168 19.2065135 ## [2241] 5.5532650 27.8444163 16.2905991 20.7252598 20.5451022 ## [2246] 19.0189091 305.3592875 1211.7307820 830.5607350 157.9516654 ## [2251] 332.2762152 608.6820466 29.2960455 850.2549701 27.5649987 ## [2256] 58.7843865 58.9131449 20.8020469 16.3922462 17.3045987 ## [2261] 22.0751162 19.3065837 13.5487022 3700.4409291 2690.8466542 ## [2266] 921.3026281 20.3910552 354.6722202 535.9595798 1022.5148646 ## [2271] 1059.9921938 1120.0749426 92.1026588 62.8741368 671.4907426 ## [2276] 38.9358959 70.3352880 415.6321610 667.5130645 59.0094936 ## [2281] 77.7688779 512.3347569 414.2077685 54.6943881 58.4255449 ## [2286] 41.8971312 43.6049428 802.2960126 538.0839246 459.7474273 ## [2291] 68.3483739 1030.8235451 818.5262489 814.3459461 31.6872250 ## [2296] 12.4907598 389.8086300 967.0567690 201.5824975 50.5715259 ## [2301] 91.5915048 290.0315088 100.3117355 1487.4880943 114.8954851 ## [2306] 197.6762929 192.8187012 46.7478690 477.0264533 605.0774727 ## [2311] 97.2964922 480.9042121 81.0660376 195.1149650 196.0576143 ## [2316] 125.6241220 280.9137068 109.7639185 137.2659648 641.8574989 ## [2321] 372.8150144 137.5740634 456.9869480 276.2609725 78.8253151 ## [2326] 24.7006696 21.6727273 304.4234477 126.1152699 329.2123661 ## [2331] 235.9443391 74.3689674 151.0762024 11.2055015 322.0550307 ## [2336] 346.6479085 797.5464719 7.1950187 189.4553105 98.0666357 ## [2341] 462.6465021 65.8783876 148.4961369 836.5992109 239.5476626 ## [2346] 829.3488227 663.8232832 41.6393498 107.2364382 169.5669251 ## [2351] 39.1287796 212.8506525 804.4543421 386.1951522 313.2469789 ## [2356] 32.0236841 38.5092659 35.9738565 85.5165241 60.9153819 ## [2361] 20.6359620 12.4448678 534.5726664 110.1651534 67.0983014 ## [2366] 555.1486480 21.3450842 541.0624211 523.0821658 24.9990611 ## [2371] 643.7229787 644.6018892 271.2654904 74.5824722 37.5369858 ## [2376] 15.0072514 28.4697383 352.0680291 32.3037684 675.1652225 ## [2381] 808.4788638 62.2275551 386.5725875 23.7846958 27.4436071 ## [2386] 75.5088032 51.5451854 793.9324919 215.1165971 30.3715045 ## [2391] 150.5445670 105.1950395 39.4538348 28.1376888 691.2108940 ## [2396] 252.9985582 351.2122775 52.2433177 524.4432126 73.3144085 ## [2401] 561.8335245 130.3086348 301.2918851 442.6079064 266.8843010 ## [2406] 129.5097695 70.0757658 54.4416202 81.6720258 538.7593960 ## [2411] 77.5779840 87.1048053 124.5669800 158.5885414 934.2300961 ## [2416] 64.9249552 37.3430808 252.0739953 912.5038812 20.6725551 ## [2421] 247.3316211 230.6694429 35.4301706 76.9298765 72.2357352 ## [2426] 1009.0033054 27.2847039 155.0224354 280.8870329 319.1599416 ## [2431] 68.5034270 6.6377491 321.3894808 242.0823388 169.5820189 ## [2436] 239.0214609 15.3261540 530.3459825 256.0528398 145.2069136 ## [2441] 165.2343981 517.4425945 290.9928552 48.3590037 717.8411643 ## [2446] 416.4182793 330.3085915 19.0464177 45.2284003 304.1634889 ## [2451] 52.7021373 50.8099816 25.4703978 426.1224030 103.8766621 ## [2456] 77.5454260 100.5573506 70.8164367 81.8530161 645.2110916 ## [2461] 974.4050372 336.1515120 171.0640775 442.0052323 108.6631758 ## [2466] 294.9183301 620.6854352 127.0667151 76.1400656 261.9105957 ## [2471] 217.9768061 482.0765432 760.9463663 75.0571549 48.6838333 ## [2476] 61.1383049 178.5547841 116.0227961 306.0043534 132.1791601 ## [2481] 37.5810536 275.4341155 40.7680941 347.8095389 774.3439643 ## [2486] 70.2526045 105.1717418 70.3037952 96.3490559 118.7054507 ## [2491] 4.4819449 155.2075557 48.9573520 27.6078831 23.2132400 ## [2496] 619.5547997 667.1076921 155.0328342 748.2516459 37.3205911 ## [2501] 44.0782651 77.7434630 11.1881534 174.4383742 40.0601063 ## [2506] 85.0516682 95.1881940 181.8944808 144.1329266 190.0769185 ## [2511] 513.7493152 360.5154071 134.4491655 100.6411298 63.6919944 ## [2516] 82.9080762 70.9590095 14.9312469 16.4268381 267.4784082 ## [2521] 55.4520418 106.8119581 29.8125334 55.3263115 23.6674570 ## [2526] 95.7640220 67.3303044 313.5489230 418.9924053 110.1230458 ## [2531] 24.3003945 23.7984326 83.7173082 44.2018431 204.6370588 ## [2536] 35.2690371 182.8010238 251.0652493 24.8039831 363.9836660 ## [2541] 144.0529831 26.4397104 996.1878161 71.7215710 780.8286896 ## [2546] 32.9078422 35.9164874 31.1833795 621.6784477 253.7973375 ## [2551] 339.4598284 23.2598697 980.2775843 203.8907021 28.7816325 ## [2556] 371.9053070 150.7170667 69.0734045 184.6923638 24.4396505 ## [2561] 107.0172354 219.7368629 108.3091929 241.1992413 124.8552289 ## [2566] 319.8298395 107.9445626 402.5165956 23.7299868 25.9744232 ## [2571] 306.1739033 279.8696297 523.5131440 145.8466533 427.4104384 ## [2576] 8.0143414 811.4739823 28.4042376 25.3300734 32.1520594 ## [2581] 16.5292006 26.8068648 50.8310198 29.7121677 221.2293077 ## [2586] 72.0570601 89.1091859 72.0045952 977.6121702 78.1537322 ## [2591] 207.1697752 399.0198586 89.4410742 152.3618724 119.6284692 ## [2596] 46.7715893 35.8287211 941.5566285 19.3860346 5.7642376 ## [2601] 6.5679901 61.4751695 22.2387709 4.9142423 214.4474686 ## [2606] 220.0587866 41.2234979 19.6771563 21.1234574 40.4355920 ## [2611] 42.1034965 45.8548036 45.5300688 13.7794780 13.5109946 ## [2616] 23.3832616 6.7231483 12.3851710 10.4135905 82.3345379 ## [2621] 158.4099155 86.7037593 26.9471321 25.1617376 6.4994976 ## [2626] 129.3311130 95.8976011 23.3783588 646.2922794 348.1949291 ## [2631] 16.9174776 18.2811258 25.5157583 23.9719072 15.9212313 ## [2636] 14.7347850 75.1716973 30.4546655 21.0489413 34.0884129 ## [2641] 27.6721213 27.0214519 34.3492897 7.8122145 6.1535684 ## [2646] 8.9096127 7.4973442 7.5223375 109.6571146 22.2479263 ## [2651] 9.0194437 15.1561654 101.3379651 9.2123280 64.8221203 ## [2656] 39.6797222 42.8297741 675.2694884 14.2985838 0.5491661 ## [2661] 21.6778794 432.0157571 2.8029649 223.7653864 89.6655923 ## [2666] 67.7572937 41.1047589 44.7404655 605.0450344 9.9189136 ## [2671] 334.6818122 69.3550500 208.3167117 241.2558955 16.2454474 ## [2676] 30.0376868 322.1916104 31.7305026 31.5627052 5.0356099 ## [2681] 26.1963606 19.5859609 204.2785128 5.6425293 193.5633787 ## [2686] 12.8364407 39.1732548 101.9332244 388.6274806 82.9231255 ## [2691] 160.8310483 17.5354231 16.9186016 4.9741079 28.3581703 ## [2696] 21.3550271 8.4948671 198.4766231 21.0003114 144.0578135 ## [2701] 20.7884511 19.2458008 26.2808242 14.0911950 33.6794971 ## [2706] 182.6818465 33.9258893 123.5879397 298.9526167 35.6183922 ## [2711] 30.4319134 3.3866628 26.9019444 440.3510391 232.5011842 ## [2716] 149.6582529 384.3010633 42.6497567 19.9196270 13.1020901 ## [2721] 7.8381567 17.4976885 55.2429590 36.1345415 8.2510237 ## [2726] 17.9618042 152.1850860 18.1368811 99.6470297 70.9899383 ## [2731] 11.3663445 92.8993402 33.0691289 62.4842535 30.8056273 ## [2736] 70.3002106 27.6326142 48.8121803 10.5502788 22.1767077 ## [2741] 21.0513414 8.3737420 39.8691342 40.2275719 43.0700818 ## [2746] 5.2599963 179.6450835 91.8409190 39.6044513 40.2840294 ## [2751] 14.7268431 23.3082507 60.8544046 22.6415702 519.2657715 ## [2756] 3.3742610 29.1791142 43.4362427 52.7324540 50.8258795 ## [2761] 34.7154622 114.8287903 14.9681656 153.1274689 33.4436558 ## [2766] 228.6996027 1015.4610066 128.3341611 155.7572350 35.1916469 ## [2771] 82.9298231 8.4514067 53.1443592 136.0348485 10.2173235 ## [2776] 210.6987839 101.6345467 604.1594286 43.4335334 216.2946360 ## [2781] 23.9303803 122.1444184 25.2983277 119.0569766 47.8806705 ## [2786] 209.2497123 81.2218588 7.6511490 17.1984918 31.5779102 ## [2791] 20.9952878 9.5520068 10.0629080 56.1296110 21.5025189 ## [2796] 196.1955390 54.0677253 45.9472890 60.2287594 13.5981996 ## [2801] 10.7503041 14.8831601 21.9722248 123.7919929 142.9410327 ## [2806] 24.0347123 13.7323732 149.3975407 152.4276999 9.7781715 ## [2811] 9.3621357 3.7266706 20.5224565 10.2615285 11.5053116 ## [2816] 17.9465451 21.2825721 3.8529650 8.5241756 17.0315910 ## [2821] 19.2716990 5.1583369 15.4499048 21.5638893 3.9584371 ## [2826] 593.2387895 40.1920396 9.6758243 97.2833167 22.5532611 ## [2831] 143.5873273 32.1405008 30.4057730 14.0176375 62.9129232 ## [2836] 186.6436991 3.4681740 42.2697487 62.3597780 6.9964779 ## [2841] 5.9750209 48.2015885 151.2283866 50.6579885 138.4186227 ## [2846] 38.1664984 57.5801033 18.9591818 81.9791633 12.1965017 ## [2851] 50.0475313 55.0806646 49.6967209 225.0175581 89.0314895 ## [2856] 126.7398664 2.5171221 142.1820956 382.3739170 48.0582022 ## [2861] 16.3592580 104.3728855 218.2250948 44.1220927 10.9958743 ## [2866] 5.5047959 8.2979517 39.9283002 11.9692689 24.1701948 ## [2871] 37.7809435 10.8159692 5.9269844 53.1235110 41.5680593 ## [2876] 5.2107656 84.4035821 18.7453677 29.0418819 45.6607371 ## [2881] 39.1372835 78.0381710 40.5201845 252.6768068 49.2096136 ## [2886] 4.3466086 13.5172408 3.7252945 35.6609919 225.2286271 ## [2891] 12.4848383 100.8502333 14.2810276 210.9115761 10.5210106 ## [2896] 9.1555428 39.1486696 4.3319948 194.7219704 7.1186718 ## [2901] 78.8112109 10.2240654 237.8023993 11.5586069 25.1398508 ## [2906] 10.1926853 27.5871576 32.8365663 8.2236427 7.3634867 ## [2911] 377.6264164 31.7092976 16.2527314 57.0711601 176.1465457 ## [2916] 16.0712064 27.1501031 15.5496403 75.2657619 52.1317841 ## [2921] 113.8650119 10.1820188 34.8811415 53.9770778 111.4697938 ## [2926] 38.0409057 142.1302372 123.3524137 19.3232578 654.1574818 ## [2931] 30.0921302 194.0711774 1199.5194141 552.4984814 28.5529880 ## [2936] 30.7237116 71.8480688 182.6891139 17.7031899 65.2021145 ## [2941] 26.3444853 49.2058314 1509.3292924 526.8015117 889.2885458 ## [2946] 611.1923488 808.8974869 888.6318608 1004.6658689 163.4607782 ## [2951] 402.5166528 409.6076438 1467.6053107 43.9158583 2026.0447205 ## [2956] 90.4562819 178.9909959 293.0753806 71.3784632 211.8232792 ## [2961] 169.3398600 128.8843488 114.3043143 31.1042841 31.1739313 ## [2966] 28.6155582 31.2810128 16.8777090 64.8539709 1197.7923561 ## [2971] 9.3354641 398.7049969 1378.9796891 312.4439803 395.8312484 ## [2976] 973.7755313 2556.6843018 1422.3600784 430.5933169 392.1714834 ## [2981] 365.4192720 1449.0320934 186.9868029 11.8677719 125.2550041 ## [2986] 2466.6161618 181.8306092 283.8057596 23.4898970 309.0954928 ## [2991] 551.6587105 385.8519414 219.4433570 60.1740618 946.1409966 ## [2996] 1191.3341945 10.1800605 1840.3407569 25.9793957 35.2322600 ## [3001] 2285.0052375 1044.8982728 415.8954615 1384.9460205 4278.5625159 ## [3006] 84.3539867 2.9081621 45.1908003 37.1371282 5.3871959 ## [3011] 54.1406230 31.4715811 203.9122374 13.4981900 342.0518910 ## [3016] 83.8623440 22.8234551 47.2592126 27.1726772 299.8004957 ## [3021] 657.8137876 89.5556609 409.8082952 258.1318515 688.0492417 ## [3026] 811.2559527 33.6051013 179.4209965 49.4032784 1312.5871681 ## [3031] 48.4655785 90.3798252 52.8109347 27.6514617 12.6905106 ## [3036] 50.8755709 11.7108179 512.9998032 1384.8805537 26.3723337 ## [3041] 211.8466690 59.6311473 316.8961511 191.3019570 34.9258500 ## [3046] 35.6501875 710.0091569 108.2213093 106.9584705 900.3890957 ## [3051] 132.4953045 134.5070310 1180.1447123 1051.0460228 1178.7086404 ## [3056] 212.6272606 236.7321244 322.4975877 165.9163386 44.5077905 ## [3061] 26.7776303 105.9073963 1076.2225515 395.8359369 397.4998703 ## [3066] 61.6568495 71.4993736 40.7472897 44.6784788 199.0841496 ## [3071] 40.1384872 146.9831061 258.6454945 41.8180951 108.8354990 ## [3076] 204.9316446 27.1301743 23.2209265 2026.4462164 134.6568929 ## [3081] 946.4838268 1093.5464858 1723.2133082 22.5930768 43.3699377 ## [3086] 538.7874503 1239.9178181 21.8520860 987.1494389 955.4941925 ## [3091] 41.6668979 397.9029732 1392.6396810 306.7951054 451.8769676 ## [3096] 301.9705347 49.4181159 50.7858156 50.7389033 233.5494225 ## [3101] 226.1110918 55.4274967 30.4575425 30.0587054 588.5487585 ## [3106] 28.1782359 3475.0925215 102.3990383 18.7063362 17.0522988 ## [3111] 16.5521198 15.5482152 19.7954068 20.4875413 8.2381604 ## [3116] 22.2538819 97.3330477 16.7245735 8.1092814 89.6607464 ## [3121] 16.7035132 17.0790696 8.7172552 69.9314318 69.7194387 ## [3126] 9.7786849 11.2961757 23.9201137 2019.1056459 96.5751266 ## [3131] 100.5220716 935.4466224 339.3941677 423.4826742 972.0492811 ## [3136] 31.5641669 185.9262463 36.2507476 41.5093656 31.7642157 ## [3141] 35.1558644 23.1240930 32.2236486 64.8903300 301.1792650 ## [3146] 27.6772412 26.1016452 11.0470811 44.8059575 42.0089230 ## [3151] 168.4667319 42.5460193 14.7640132 20.3583268 17.7193775 ## [3156] 6.2316915 19.9399574 557.7125605 1060.6121759 28.6432198 ## [3161] 1535.1036973 27.9821013 28.2640158 947.8768172 950.0688263 ## [3166] 62.2955170 219.3605735 349.5157125 8.8997550 299.9718685 ## [3171] 217.9716054 28.4437732 143.3324565 146.2821148 24.9047027 ## [3176] 24.9352402 519.3232045 523.0836665 522.6373177 649.4809268 ## [3181] 88.9552643 7.8418833 119.3865984 49.0608686 33.2626573 ## [3186] 34.9892349 28.6593586 31.9252703 216.5330588 8.6514373 ## [3191] 10.2876734 21.8476171 22.5269300 47.3054538 29.9112786 ## [3196] 72.6447750 9.2774424 69.9746244 121.3320870 141.8402644 ## [3201] 55.5894722 41.1378334 21.7766999 470.5677699 41.5669089 ## [3206] 29.6130133 32.7194920 182.1620675 28.2891810 85.4308530 ## [3211] 1379.1559919 224.1704525 3559.7258348 364.1613353 170.4178784 ## [3216] 96.4954196 186.1240066 186.6496508 34.7526225 215.1260539 ## [3221] 401.4687671 113.9729240 245.6334912 10.7511409 631.5509958 ## [3226] 36.8366519 38.7719330 18.0063834 25.3571943 287.2990208 ## [3231] 282.7603488 582.5147936 37.7762287 974.3608607 125.2844419 ## [3236] 15.3779195 661.9868331 10.7077907 58.3751302 13.6131176 ## [3241] 60.8988736 16.2753784 282.8491386 379.9458482 1214.4706840 ## [3246] 93.2101103 295.2902162 53.0832081 21.1651339 67.7274074 ## [3251] 179.7217493 16.5810783 57.2193496 71.2323194 71.6146175 ## [3256] 271.0931516 5.0724083 650.8364311 151.3961870 93.5184015 ## [3261] 37.1073157 64.4723965 12.7556437 89.0500260 49.4290261 ## [3266] 11.1005670 22.1219476 3.2197054 12.7782426 396.9271416 ## [3271] 21.3673555 3.0428028 149.3769770 31.6038669 47.4559294 ## [3276] 102.2409385 32.2823928 16.4485899 4.6767674 10.7268315 ## [3281] 44.1662197 18.9343046 122.6306754 107.7859104 51.5119495 ## [3286] 34.3257819 26.7165759 49.5461575 6.2024301 36.6901829 ## [3291] 243.5855723 204.3425721 288.7291262 216.5492190 59.6686514 ## [3296] 66.1822257 26.6773206 314.5636698 5.6405450 9.1691482 ## [3301] 72.4960839 220.4897585 100.6376792 27.3252899 21.6667653 ## [3306] 47.2919298 1035.4273417 11.3739562 1888.5173256 25.6327183 ## [3311] 30.5414887 1268.6819144 11.4956263 8.7459452 16.0121340 ## [3316] 8.4580018 129.5777079 127.7735797 27.7401131 30.5941835 ## [3321] 28.9176985 0.5453094 21.8303530 185.3737227 259.4207547 ## [3326] 132.8231797 ``` ] --- # Load and explore point data We'll load a dataset of the location of schools ```r schools_df <- read_csv(here("DataWork", "DataSets", "Final", "schools.csv")) ``` ``` ## Rows: 3546 Columns: 5 ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: "," ## chr (2): name, amenity ## dbl (3): osm_id, longitude, latitude ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. ``` --- # Explore data ```r head(schools_df) ``` ``` ## # A tibble: 6 × 5 ## osm_id name amenity longitude latitude ## <dbl> <chr> <chr> <dbl> <dbl> ## 1 30312225 Consolata School school 36.8 -1.27 ## 2 674552830 <NA> <NA> 36.8 -1.26 ## 3 1399125354 Galitos restaurant school 36.8 -1.29 ## 4 1764153756 Makini Schools school 36.8 -1.30 ## 5 1867185524 Bohra Primary School school 36.8 -1.26 ## 6 2061462027 <NA> <NA> 36.8 -1.26 ``` --- # Explore data ```r names(schools_df) ``` ``` ## [1] "osm_id" "name" "amenity" "longitude" "latitude" ``` --- # Convert to spatial object We define the (1) coordinates (longitude and latitude) and (2) CRS. __Note:__ We must determine the CRS from the data metadata. This dataset comes from OpenStreetMaps, which uses EPSG:4326. __Assigning the incorrect CRS is one of the most common sources of issues I see with geospatial work. If something looks weird, check the CRS!__ ```r schools_sf <- st_as_sf(schools_df, coords = c("longitude", "latitude"), crs = 4326) ``` --- # Convert to spatial object ```r head(schools_sf$geometry) ``` ``` ## Geometry set for 6 features ## Geometry type: POINT ## Dimension: XY ## Bounding box: xmin: 36.76877 ymin: -1.296051 xmax: 36.80406 ymax: -1.258515 ## Geodetic CRS: WGS 84 ## First 5 geometries: ``` ``` ## POINT (36.80406 -1.267486) ``` ``` ## POINT (36.79734 -1.25969) ``` ``` ## POINT (36.77077 -1.290325) ``` ``` ## POINT (36.76877 -1.296051) ``` ``` ## POINT (36.79066 -1.258515) ``` --- # Map points object: Using sf ```r ggplot() + geom_sf(data = schools_sf) ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-21-1.png" width="50%" style="display: block; margin: auto;" /> --- # Map points object: Using dataframe ```r ggplot() + geom_point(data = schools_df, aes(x = longitude, y = latitude)) ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-22-1.png" width="50%" style="display: block; margin: auto;" /> --- # Make better static map Lets make a better static map. ```r # Adding a variable with squared km city_sf <- city_sf %>% mutate(area_m = city_sf %>% st_area() %>% as.numeric(), area_km = area_m / 1000^2) # Plotting ggplot() + geom_sf(data = city_sf, aes(fill = area_km)) + labs(fill = "Area") + scale_fill_distiller(palette = "Blues") + theme_void() ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-23-1.png" width="50%" style="display: block; margin: auto;" /> --- # Make better static map Lets add another spatial layer ```r ggplot() + geom_sf(data = city_sf, aes(fill = area_km)) + geom_sf(data = schools_sf, aes(color = "Schools")) + labs(fill = "Area", color = NULL) + scale_fill_distiller(palette = "Blues") + scale_color_manual(values = "black") + theme_void() ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-24-1.png" width="40%" style="display: block; margin: auto;" /> --- # Another static map .exercise[ **Exercise:** Make a static map of roads, coloring each road by its type. (__Hint:__ The `highway` variable indicates the type). ]
−
+
01
:
00
-- .solution[ **Solution**: ```r ggplot() + geom_sf(data = roads_sf, aes(color = highway)) + theme_void() + labs(color = "Road Type") ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-25-1.png" style="display: block; margin: auto;" /> ] --- # Another static map ```r ggplot() + geom_sf(data = roads_sf, aes(color = highway)) + theme_void() + labs(color = "Road Type") ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-26-1.png" style="display: block; margin: auto;" /> --- # Interactive map We use the `leaflet` package to make interactive maps. Leaflet is a JavaScript library, but the `leaflet` R package allows making interactive maps using R. Use of leaflet somewhat mimics how we use ggplot. * Start with `leaflet()` (instead of `ggplot()`) * Add spatial layers, defining type of layer (similar to geometries) ```r leaflet() %>% addTiles() # Basemap ```
--- # Interactive map We use the `leaflet` package to make interactive maps. Leaflet is a JavaScript library, but the `leaflet` R package allows making interactive maps using R. Use of leaflet somewhat mimics how we use ggplot. * Start with `leaflet()` (instead of `ggplot()`) * Add spatial layers, defining type of layer (similar to geometries) ```r leaflet() %>% addTiles() %>% addPolygons(data = city_sf) ```
--- # Interactive map Add a pop-up ```r leaflet() %>% addTiles() %>% addPolygons(data = city_sf, popup = ~NAME_2) ```
--- # Interactive map Add more than one layer ```r leaflet() %>% addTiles() %>% addPolygons(data = city_sf, popup = ~NAME_2) %>% addCircles(data = schools_sf, popup = ~name, color = "black") ```
--- # Interactive map of roads .exercise[ **Exercise:** Create a leaflet map with roads, using the `roads_sf` dataset. (__Hint:__ Use `addPolylines()`) ]
−
+
02
:
00
-- .solution[ **Solution**: ```r leaflet() %>% addTiles() %>% addPolylines(data = roads_sf) ``` ] --- # Interactive map of roads ```r leaflet() %>% addTiles() %>% addPolylines(data = roads_sf) ```
--- # Interactive maps We can spent lots of time going over what we can done with leaflet - but that would take up too much time. [This resource](https://rstudio.github.io/leaflet/articles/colors.html) provides helpful tutorials for things like: * Changing the basemap * Adding colors * Adding a legend * And much more! --- # Spatial operations applied on single dataset * `st_transform`: Transform CRS * `st_buffer`: Buffer point/line/polygon * `st_combine`: Dissolve by attribute * `st_convex_hull `: Create convex hull * `st_centroid`: Create new sf object that uses the centroid * `st_drop_geometry`: Drop geometry; convert from sf to dataframe * `st_coordinates`: Get matrix of coordinates * `st_bbox`: Get bounding box --- # Transform CRS The schools dataset is currently in a geographic CRS (WGS84), where the units are in decimal degrees. We'll tranform the CRS to a projected CRS ([EPSG:32632](https://epsg.io/32632)), and where the units will be in meters. __Note that coordinate values are large!__ Values are large because units are in meters. Large coordinate values suggest projected CRS; latitude is between -90 and 90 and longitude is between -180 and 180. ```r schools_utm_sf <- st_transform(schools_sf, 32632) schools_utm_sf$geometry %>% head(2) %>% print() ``` ``` ## Geometry set for 2 features ## Geometry type: POINT ## Dimension: XY ## Bounding box: xmin: 3722217 ymin: -158522.3 xmax: 3723051 ymax: -157537.6 ## Projected CRS: WGS 84 / UTM zone 32N ``` ``` ## POINT (3723051 -158522.3) ``` ``` ## POINT (3722217 -157537.6) ``` --- # Buffer We have the points of schools. Now we create a 1km buffer around schools. ```r schools_1km_sf <- schools_sf %>% st_buffer(dist = 1000) # Units are in meters. Thanks s2! ggplot() + geom_sf(data = schools_1km_sf) ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-29-1.png" width="50%" style="display: block; margin: auto;" /> --- # Dissolve by an attribute Below we have the second administrative regions. Using this dataset, let's create a new object at the first administrative region level. ```r country_1_sf <- country_sf %>% group_by(NAME_1) %>% summarise(geometry = st_combine(geometry)) %>% ungroup() ggplot() + geom_sf(data = country_1_sf) ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-30-1.png" width="30%" style="display: block; margin: auto;" /> --- # Exercise .exercise[ **Exercise:** Create a polyline of all trunk roads (dissolve it using `st_combine`), and buffer the polyline by 10 meters. In `roads_sf`, the `highway` variable notes road types. ]
−
+
02
:
00
-- .solution[ **Solution**: ```r roads_sf %>% filter(highway == "trunk") %>% summarise(geometry = st_combine(geometry)) %>% st_buffer(dist = 10) ``` ``` ## Simple feature collection with 1 feature and 0 fields ## Geometry type: MULTIPOLYGON ## Dimension: XY ## Bounding box: xmin: 36.68359 ymin: -1.430867 xmax: 37.07692 ymax: -1.204784 ## Geodetic CRS: WGS 84 ## geometry ## 1 MULTIPOLYGON (((36.76646 -1... ``` ] --- # Convex Hull __Simple definition:__ Get the outer-most coordinates of a shape and connect-the-dots. __Formal definition:__ A convex hull of a shape the smallest "convex set" that contains it. (A [convex set](https://en.wikipedia.org/wiki/Convex_set) is where a straight line can be drawn anywhere in the space and the space fully contains the line). .pull-left[ __Convex__  ] .pull-right[ __Not convex__  ] __Source:__ [Wikipedia](https://en.wikipedia.org/wiki/Convex_set) --- # Convex hull In the below example, we create a conex hull around schools; creating a polygon that includes all schools. __Incorrect attempt__ ```r schools_chull1_sf <- schools_sf %>% st_convex_hull() nrow(schools_chull1_sf) ``` ``` ## [1] 3546 ``` --- # Convex hull __Correct__ ```r schools_chull2_sf <- schools_sf %>% summarise(geometry = st_combine(geometry)) %>% st_convex_hull() ggplot() + geom_sf(data = schools_chull2_sf) + geom_sf(data = schools_sf, color = "red") ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-33-1.png" width="40%" style="display: block; margin: auto;" /> --- # Determine centroid Sometimes we want to represent a polygon or polyline as a single point. For this, we can compute the centroid (ie, geographic center) of a polygon/polyline. .center[  ] __Source:__ [Wikipedia](https://en.wikipedia.org/wiki/Centroid) --- # Determine centroid Determine centroid of second administrative regions ```r country_c_sf <- st_centroid(country_sf) ``` ``` ## Warning: st_centroid assumes attributes are constant over geometries ``` ```r ggplot() + geom_sf(data = country_c_sf) ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-34-1.png" width="40%" style="display: block; margin: auto;" /> --- # Remove geometry __Incorrect approach__ ```r city_sf %>% select(-geometry) %>% head() ``` ``` ## Simple feature collection with 6 features and 15 fields ## Geometry type: MULTIPOLYGON ## Dimension: XY ## Bounding box: xmin: 36.67803 ymin: -1.370704 xmax: 36.99025 ymax: -1.234921 ## Geodetic CRS: WGS 84 ## GID_2 GID_0 COUNTRY GID_1 NAME_1 NL_NAME_1 NAME_2 ## 1 KEN.30.1_1 KEN Kenya KEN.30_1 Nairobi <NA> Dagoretti North ## 2 KEN.30.2_1 KEN Kenya KEN.30_1 Nairobi <NA> Dagoretti South ## 3 KEN.30.3_1 KEN Kenya KEN.30_1 Nairobi <NA> Embakasi Central ## 4 KEN.30.4_1 KEN Kenya KEN.30_1 Nairobi <NA> Embakasi East ## 5 KEN.30.5_1 KEN Kenya KEN.30_1 Nairobi <NA> Embakasi North ## 6 KEN.30.6_1 KEN Kenya KEN.30_1 Nairobi <NA> Embakasi South ## VARNAME_2 NL_NAME_2 TYPE_2 ENGTYPE_2 CC_2 HASC_2 area_m area_km ## 1 <NA> <NA> Constituency Constituency 275 <NA> 26850519 26.850519 ## 2 <NA> <NA> Constituency Constituency 276 <NA> 28881788 28.881788 ## 3 <NA> <NA> Constituency Constituency 284 <NA> 8249195 8.249195 ## 4 <NA> <NA> Constituency Constituency 285 <NA> 86236564 86.236564 ## 5 <NA> <NA> Constituency Constituency 283 <NA> 5451808 5.451808 ## 6 <NA> <NA> Constituency Constituency 282 <NA> 17635838 17.635838 ## geometry ## 1 MULTIPOLYGON (((36.76082 -1... ## 2 MULTIPOLYGON (((36.75381 -1... ## 3 MULTIPOLYGON (((36.9181 -1.... ## 4 MULTIPOLYGON (((36.97557 -1... ## 5 MULTIPOLYGON (((36.89368 -1... ## 6 MULTIPOLYGON (((36.9065 -1.... ``` --- # Remove geometry __Correct__ ```r city_sf %>% st_drop_geometry() %>% head() ``` ``` ## GID_2 GID_0 COUNTRY GID_1 NAME_1 NL_NAME_1 NAME_2 ## 1 KEN.30.1_1 KEN Kenya KEN.30_1 Nairobi <NA> Dagoretti North ## 2 KEN.30.2_1 KEN Kenya KEN.30_1 Nairobi <NA> Dagoretti South ## 3 KEN.30.3_1 KEN Kenya KEN.30_1 Nairobi <NA> Embakasi Central ## 4 KEN.30.4_1 KEN Kenya KEN.30_1 Nairobi <NA> Embakasi East ## 5 KEN.30.5_1 KEN Kenya KEN.30_1 Nairobi <NA> Embakasi North ## 6 KEN.30.6_1 KEN Kenya KEN.30_1 Nairobi <NA> Embakasi South ## VARNAME_2 NL_NAME_2 TYPE_2 ENGTYPE_2 CC_2 HASC_2 area_m area_km ## 1 <NA> <NA> Constituency Constituency 275 <NA> 26850519 26.850519 ## 2 <NA> <NA> Constituency Constituency 276 <NA> 28881788 28.881788 ## 3 <NA> <NA> Constituency Constituency 284 <NA> 8249195 8.249195 ## 4 <NA> <NA> Constituency Constituency 285 <NA> 86236564 86.236564 ## 5 <NA> <NA> Constituency Constituency 283 <NA> 5451808 5.451808 ## 6 <NA> <NA> Constituency Constituency 282 <NA> 17635838 17.635838 ``` --- # Grab coordinates Create a matrix of coordinates ```r schools_sf %>% st_coordinates() %>% head() ``` ``` ## X Y ## [1,] 36.80406 -1.267486 ## [2,] 36.79734 -1.259690 ## [3,] 36.77077 -1.290325 ## [4,] 36.76877 -1.296051 ## [5,] 36.79066 -1.258515 ## [6,] 36.77899 -1.264575 ``` --- # Get bounding box ```r schools_sf %>% st_bbox() ``` ``` ## xmin ymin xmax ymax ## 36.691965 -1.374473 37.065336 -1.177316 ``` --- # Spatial operations using multiple datasets * `st_distance`: Calculate distances. * `st_intersects`: Indicates whether simple features intersect. * `st_intersection`: Cut one spatial object based on another. * `st_difference`: Remove part of spatial object based on another. * `st_join`: Spatial join (ie, add attributes of one dataframe to another based on location). --- # Distances For this example, we'll compute the distance between each school to a motorway. ```r motor_sf <- roads_sf %>% filter(highway == "motorway") # Matrix: distance of each school to each motorway dist_mat <- st_distance(schools_sf, motor_sf) # Take minimun distance for each school dist_mat %>% apply(1, min) %>% head() ``` ``` ## [1] 33.78464 155.32799 4006.16459 4662.68796 176.10524 1382.28513 ``` --- # Exercise .exercise[ **Exercise:** Calculate the distance from the centroid of each second administrtaive division to the nearest trunk road. ]
−
+
02
:
00
-- .solution[ **Solution**: ```r city_cent_sf <- city_sf %>% st_centroid() ``` ``` ## Warning: st_centroid assumes attributes are constant over geometries ``` ```r trunk_sf <- roads_sf %>% filter(highway == "trunk") # Matrix: distance of each school to each motorway dist_mat <- st_distance(city_cent_sf, trunk_sf) # Take minimun distance for each school dist_mat %>% apply(1, min) %>% head() ``` ``` ## [1] 2127.34583 2215.07338 929.39785 5642.60850 2015.55906 19.97698 ``` ] # Distances There are multiple ways to calculate distances! * __Great circle:__ sf, by default, uses s2 to computer distance (in meters) when data has a geographic CRS * __Great circle:__ Other formulas beyond s2, such as Haversine, Vincenty, and Karney’s method. See the [geosphere](https://cran.r-project.org/web/packages/geosphere/geosphere.pdf) and [geodist](https://cran.r-project.org/web/packages/geodist/geodist.pdf) packages. Vincenty is more precise than Haversine, and Karney's method is more precise than Vincenty's method. Greater precision comes with heavy computation. For more information, see [here](https://rspatial.org/raster/sphere/2-distance.html). * __Projected:__ We can use a projected CRS, where units are in meters already. --- # Distances .pull-left[ ```r # s2 st_distance(schools_sf[1,], schools_sf[2,]) %>% as.numeric() ``` ``` ## [1] 1144.271 ``` ```r # Nigeria-specific CRS schools_utm_sf <- st_transform(schools_sf, 32632) st_distance(schools_utm_sf[1,], schools_utm_sf[2,]) %>% as.numeric() ``` ``` ## [1] 1290.671 ``` ```r # World mercator schools_merc_sf <- st_transform(schools_sf, 3395) st_distance(schools_merc_sf[1,], schools_merc_sf[2,]) %>% as.numeric() ``` ``` ## [1] 1141.436 ``` ] .pull-right[ ```r # Haversine distHaversine( p1 = schools_sf[1,] %>% st_coordinates, p2 = schools_sf[2,] %>% st_coordinates) ``` ``` ## [1] 1145.551 ``` ```r # Vincenty's method distVincentySphere( p1 = schools_sf[1,] %>% st_coordinates, p2 = schools_sf[2,] %>% st_coordinates) ``` ``` ## [1] 1145.551 ``` ```r # Karney’s method distGeo(p1 = schools_sf[1,] %>% st_coordinates, p2 = schools_sf[2,] %>% st_coordinates) ``` ``` ## [1] 1141.16 ``` ] --- # Intersects For this example we'll determine which second administrative divisions intersects with a motorway. ```r # Sparse matrix st_intersects(city_sf, motor_sf) %>% print() ``` ``` ## Sparse geometry binary predicate list of length 17, where the predicate ## was `intersects' ## first 10 elements: ## 1: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ... ## 2: (empty) ## 3: (empty) ## 4: 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, ... ## 5: (empty) ## 6: 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, ... ## 7: (empty) ## 8: (empty) ## 9: (empty) ## 10: 42, 43, 45, 64 ``` --- # Intersects Take `max` (`FALSE` corresponds to 0 and `TRUE` corresponds to 1). So taking max will yeild if unit intersects with _any_ motorway ```r # Matrix st_intersects(city_sf, motor_sf, sparse = F) %>% apply(1, max) %>% head() ``` ``` ## [1] 1 0 0 1 0 1 ``` --- # Exercise .exercise[ **Exercise:** Determine which motorways intersect with a trunk road ]
−
+
02
:
00
-- .solution[ **Solution**: ```r trunk_sf <- roads_sf %>% filter(highway == "trunk") motor_sf <- roads_sf %>% filter(highway == "motorway") st_intersects(motor_sf, trunk_sf, sparse = F) %>% apply(1, max) %>% head() ``` ] --- # Intersection We have roads for the full city. Here, we want to create new roads object that __only includes__ roads in one unit. ```r loc_sf <- city_sf %>% head(1) roads_loc_sf <- st_intersection(roads_sf, loc_sf) ``` ``` ## Warning: attribute variables are assumed to be spatially constant throughout ## all geometries ``` ```r ggplot() + geom_sf(data = roads_loc_sf) ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-46-1.png" width="40%" style="display: block; margin: auto;" /> --- # Difference We have roads for all of the city. Here, we want to create new roads object that __excludes__ roads in one unit. ```r roads_notloc_sf <- st_difference(roads_sf, loc_sf) ``` ``` ## Warning: attribute variables are assumed to be spatially constant throughout ## all geometries ``` ```r ggplot() + geom_sf(data = loc_sf, fill = NA, color = "red") + geom_sf(data = roads_notloc_sf) ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-47-1.png" width="40%" style="display: block; margin: auto;" /> --- # Overlay Intersections and differencing are __overlay__ functions .center[  ] --- # Exercise .exercise[ **Exercise:** Create a map of schools that are within 1km of a motorway. ]
−
+
02
:
00
-- .solution[ **Solution**: ```r motor_1km_sf <- roads_sf %>% filter(highway == "motorway") %>% st_buffer(dist = 1000) schools_nr_motor_sf <- schools_sf %>% st_intersection(motor_1km_sf) leaflet() %>% addTiles() %>% addCircles(data = schools_nr_motor_sf) ``` ] --- # Exercise Note that there are multiple approaches we could have used for creating a map of schools that are within 1km of a trunk road. 1. Buffer trunk roads by 1km and do a spatial intersection with schools 2. Calculate the distance of each school to the nearest trunk road, then filter schools that are within 1km of a trunk road --- # Spatial join We have a dataset of schools. The school dataframe contains information such as the school name, but not on the administrative region it's in. To add data on the administrative region that the school is in, we'll perform a spatial join. Check the variable names. No names of second administrative divison :( ```r names(schools_sf) ``` ``` ## [1] "osm_id" "name" "amenity" "geometry" ``` --- # Spatial join Use `st_join` to add attributes from `city_sf` to `schools_sf`. `st_join` is similar to other join methods (eg, `left_join`); instead of joining on a varible, we join based on location. ```r schools_city_sf <- st_join(schools_sf, city_sf) schools_city_sf %>% names() %>% print() %>% tail(10) ``` ``` ## [1] "osm_id" "name" "amenity" "geometry" "GID_2" "GID_0" ## [7] "COUNTRY" "GID_1" "NAME_1" "NL_NAME_1" "NAME_2" "VARNAME_2" ## [13] "NL_NAME_2" "TYPE_2" "ENGTYPE_2" "CC_2" "HASC_2" "area_m" ## [19] "area_km" ``` ``` ## [1] "NL_NAME_1" "NAME_2" "VARNAME_2" "NL_NAME_2" "TYPE_2" "ENGTYPE_2" ## [7] "CC_2" "HASC_2" "area_m" "area_km" ``` --- # Spatial join .exercise[ **Exercise:** Make a static map using of administrative areas, where each administrative area polygon displays the number of schools within the administrative area. ] -- .solution[ **Solution**: ```r ## Dataframe of number of schools per NAME_2 n_school_df <- schools_city_sf %>% st_drop_geometry() %>% group_by(NAME_2) %>% summarise(n_school = n()) %>% ungroup() ## Merge info with city_sf city_sch_sf <- city_sf %>% left_join(n_school_df, by = "NAME_2") ## Map p <- ggplot() + geom_sf(data = city_sch_sf, aes(fill = n_school)) ``` ] --- # Spatial join ```r ggplot() + geom_sf(data = city_sch_sf, aes(fill = n_school)) + labs(fill = "N\nSchools") + scale_fill_distiller(palette = "YlOrRd") + theme_void() ``` <img src="06-spatial-data_files/figure-html/unnamed-chunk-52-1.png" width="65%" style="display: block; margin: auto;" /> --- # Spatial join Let's outsource to [chatGPT](https://chatgpt.com/) (or [gemini](https://gemini.google.com/app) or your other favorite AI). Try entering the below prompt into chatGPT to see how it does. Does chatGPT give a correct answer? Do you need to modify chatGPT's output to make it work? _In R, I have an sf points object of schools called schools_sf. I also have the second administrative divisions of a city as an sf polygon called city_sf and where each location is uniquely defined by the variable NAME_2. Make a static map using of administrative areas, where each administrative area polygon displays the number of schools within the administrative area. Provide R code for this._ --- # Resources .large[ * [sf package cheatsheet](https://github.com/rstudio/cheatsheets/blob/main/sf.pdf) * [Spatial Data Science with Applications in R](https://r-spatial.org/book/) * [Geocomputation with R](https://r.geocompx.org/) ] --- # Thank you! .center[ <img src="img/werner_projection.jpg" width = 500> ]