Skip to content

Commit d939aeb

Browse files
committed
Deploy commit: Merge pull request #1130 from geocompx/c11-proofing
c11 proofing 4e72474
1 parent 3001cdc commit d939aeb

37 files changed

+133
-133
lines changed

02-spatial-data.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ If you are new to R, we recommend following introductory R resources such as [Ha
1818
These resources cover in detail how to install R, which simply involves downloading the latest version from the [Comprehensive R Archive Network (CRAN)](https://cran.r-project.org/).
1919
See the note below for more information on installing R for geocomputation on Mac and Linux.
2020
Organize your work into [projects](https://r4ds.had.co.nz/workflow-projects.html) and give scripts sensible names such as `chapter-02.R` (or equivalent RMarkdown or Quarto file names) to document the code as you learn.
21-
\index{R!pre-requisites}
21+
\index{R!prerequisites}
2222

2323
\index{R!installation}
2424
\BeginKnitrBlock{rmdnote}<div class="rmdnote">Mac and Linux operating systems (OSs) have additional systems requirements, which can be found in the README of the [**sf** package](https://github.com/r-spatial/sf).
@@ -74,7 +74,7 @@ We will introduce the theory behind each data model and the disciplines in which
7474
The *vector data model* represents the world using points, lines and polygons.
7575
These have discrete, well-defined borders, meaning that vector datasets usually have a high level of precision (but not necessarily accuracy as we will see in Section \@ref(units)).
7676
The *raster data model* divides the surface up into cells of constant size.
77-
Raster datasets are the basis of background images used in web-mapping and have been a vital source of geographic data since the origins of aerial photography and satellite-based remote sensing devices.
77+
Raster datasets are the basis of background images used in web mapping and have been a vital source of geographic data since the origins of aerial photography and satellite-based remote sensing devices.
7878
Rasters aggregate spatially specific features to a given resolution, meaning that they are consistent over space and scalable (many worldwide raster datasets are available).
7979

8080
Which to use?

05-geometry-operations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ A variety of georeferencing techniques exist, including:
607607

608608
- Georectification based on known [ground control points](https://www.qgistutorials.com/en/docs/3/georeferencing_basics.html)
609609
- Orthorectification, which also accounts for local topography
610-
- Image [registration](https://en.wikipedia.org/wiki/Image_registration) is used to combine images of the same thing but shot from different sensors by aligning one image with another (in terms of coordinate system and resolution)
610+
- Image [registration](https://en.wikipedia.org/wiki/Image_registration) is used to combine images of the same thing, but shot from different sensors by aligning one image with another (in terms of coordinate system and resolution)
611611

612612
R is rather unsuitable for the first two points since these often require manual intervention which is why they are usually done with the help of dedicated GIS software (see also Chapter \@ref(gis)).
613613
On the other hand, aligning several images is possible in R and this section shows among others how to do so.

07-reproj.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Having a clearly defined CRS that all project data is in, and understanding how
3030
Furthermore, learning about coordinate systems will deepen your knowledge of geographic datasets and how to use them effectively.
3131

3232
This chapter teaches the fundamentals of CRSs, demonstrates the consequences of using different CRSs (including what can go wrong), and how to 'reproject' datasets from one coordinate system to another.
33-
In the next section we introduce CRSs in R, followed by Section \@ref(crs-setting) which shows how to get and set CRSs associated with spatial objects.
33+
In the next section, we introduce CRSs in R, followed by Section \@ref(crs-setting) which shows how to get and set CRSs associated with spatial objects.
3434
Section \@ref(geom-proj) demonstrates the importance of knowing what CRS your data is in with reference to a worked example of creating buffers.
3535
We tackle questions of when to reproject and which CRS to use in Section \@ref(whenproject) and Section \@ref(which-crs), respectively.
3636
Finally, we cover reprojecting vector and raster objects in Sections \@ref(reproj-vec-geom) and \@ref(reproj-ras) and modifying map projections in Section \@ref(mapproj).

09-mapping.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -911,25 +911,25 @@ leaflet(data = cycle_hire) |>
911911
\index{map-making!mapping applications}
912912
The interactive web maps demonstrated in Section \@ref(interactive-maps) can go far.
913913
Careful selection of layers to display, basemaps and pop-ups can be used to communicate the main results of many projects involving geocomputation.
914-
But the web-mapping approach to interactivity has limitations:
914+
But the web mapping approach to interactivity has limitations:
915915

916916
- Although the map is interactive in terms of panning, zooming and clicking, the code is static, meaning the user interface is fixed
917917
- All map content is generally static in a web map, meaning that web maps cannot scale to handle large datasets easily
918-
- Additional layers of interactivity, such a graphs showing relationships between variables and 'dashboards', are difficult to create using the web-mapping-approach
918+
- Additional layers of interactivity, such a graphs showing relationships between variables and 'dashboards', are difficult to create using the web mapping-approach
919919

920920
Overcoming these limitations involves going beyond static web mapping and toward geospatial frameworks and map servers.
921921
Products in this field include [GeoDjango](https://docs.djangoproject.com/en/4.0/ref/contrib/gis/)\index{GeoDjango} (which extends the Django web framework and is written in [Python](https://github.com/django/django))\index{Python}, [MapServer](https://github.com/mapserver/mapserver)\index{MapServer} (a framework for developing web applications, largely written in C and C++)\index{C++} and [GeoServer](https://github.com/geoserver/geoserver) (a mature and powerful map server written in Java\index{Java}).
922922
Each of these is scalable, enabling maps to be served to thousands of people daily, assuming there is sufficient public interest in your maps!
923923
The bad news is that such server-side solutions require much skilled developer time to set up and maintain, often involving teams of people with roles such as a dedicated geospatial database administrator ([DBA](https://wiki.gis.com/wiki/index.php/Database_administrator)).
924924

925-
Fortunately for R programmers, web-mapping applications can now be rapidly created with **shiny**.\index{shiny (package)}
925+
Fortunately for R programmers, web mapping applications can now be rapidly created with **shiny**.\index{shiny (package)}
926926
As described in the open source book [Mastering Shiny](https://mastering-shiny.org/), **shiny** is an R package and framework for converting R code into interactive web applications [@wickham_mastering_2021].
927927
You can embed interactive maps in shiny apps thanks to functions such as <!--`tmap::renderTmap()` and -->[`leaflet::renderLeaflet()`](https://rstudio.github.io/leaflet/shiny.html).
928-
This section gives some context, teaches the basics of **shiny** from a web-mapping perspective, and culminates in a full-screen mapping application in less than 100 lines of code.
928+
This section gives some context, teaches the basics of **shiny** from a web mapping perspective, and culminates in a full-screen mapping application in less than 100 lines of code.
929929

930930
**shiny** is well documented at [shiny.posit.co](https://shiny.posit.co/), which highlights the two components of every **shiny** app: 'front end' (the bit the user sees) and 'back end' code.
931931
In **shiny** apps, these elements are typically created in objects named `ui` and `server` within an R script named `app.R`, which lives in an 'app folder'.
932-
This allows web-mapping applications to be represented in a single file, such as the [`CycleHireApp/app.R`](https://github.com/geocompx/geocompr/blob/main/apps/CycleHireApp/app.R) file in the book's GitHub repo.
932+
This allows web mapping applications to be represented in a single file, such as the [`CycleHireApp/app.R`](https://github.com/geocompx/geocompr/blob/main/apps/CycleHireApp/app.R) file in the book's GitHub repo.
933933

934934
\BeginKnitrBlock{rmdnote}<div class="rmdnote">In **shiny** apps these are often split into `ui.R` (short for user interface) and `server.R` files, naming conventions used by `shiny-server`, a server-side Linux application for serving shiny apps on public-facing websites.
935935
`shiny-server` also serves apps defined by a single `app.R` file in an 'app folder'.
@@ -959,8 +959,8 @@ shinyApp(ui, server)
959959
```
960960

961961
<div class="figure" style="text-align: center">
962-
<img src="images/shiny-app.png" alt="Screenshot showing minimal example of a web-mapping application created with shiny." width="100%" />
963-
<p class="caption">(\#fig:lifeApp)Screenshot showing minimal example of a web-mapping application created with shiny.</p>
962+
<img src="images/shiny-app.png" alt="Screenshot showing minimal example of a web mapping application created with shiny." width="100%" />
963+
<p class="caption">(\#fig:lifeApp)Screenshot showing minimal example of a web mapping application created with shiny.</p>
964964
</div>
965965

966966
The **user interface** (`ui`) of lifeApp is created by `fluidPage()`.
@@ -979,20 +979,20 @@ The example contains some of the components of a web mapping application impleme
979979

980980
The `CycleHireApp/app.R` script contains **shiny** functions that go beyond those demonstrated in the simple 'lifeApp' example (Figure \@ref(fig:CycleHireApp-html)).
981981
These include `reactive()` and `observe()` (for creating outputs that respond to the user interface --- see `?reactive`) and `leafletProxy()` (for modifying a `leaflet` object that has already been created).
982-
Such elements are critical to the creation of web-mapping applications implemented in **shiny**.
982+
Such elements are critical to the creation of web mapping applications implemented in **shiny**.
983983
A range of 'events' can be programmed including advanced functionality such as drawing new layers or subsetting data, as described in the shiny section of RStudio's **leaflet** [website](https://rstudio.github.io/leaflet/shiny.html).
984984

985985
\BeginKnitrBlock{rmdnote}<div class="rmdnote">There are a number of ways to run a **shiny** app.
986986
For RStudio users, the simplest way is probably to click on the 'Run App' button located in the top right of the source pane when an `app.R`, `ui.R` or `server.R` script is open.
987987
**shiny** apps can also be initiated by using `runApp()` with the first argument being the folder containing the app code and data: `runApp("CycleHireApp")` in this case (which assumes a folder named `CycleHireApp` containing the `app.R` script is in your working directory).
988988
You can also launch apps from a Unix command line with the command `Rscript -e 'shiny::runApp("CycleHireApp")'`.</div>\EndKnitrBlock{rmdnote}
989989

990-
Experimenting with apps such as `CycleHireApp` will build not only your knowledge of web-mapping applications in R, but also your practical skills.
990+
Experimenting with apps such as `CycleHireApp` will build not only your knowledge of web mapping applications in R, but also your practical skills.
991991
Changing the contents of `setView()`, for example, will change the starting bounding box that the user sees when the app is initiated.
992992
Such experimentation should not be done at random, but with reference to relevant documentation, starting with `?shiny`, and motivated by a desire to solve problems such as those posed in the exercises.
993993

994994
**shiny** used in this way can make prototyping mapping applications faster and more accessible than ever before (deploying **shiny** apps, https://shiny.posit.co/deploy/, is a separate topic beyond the scope of this chapter).
995-
Even if your applications are eventually deployed using different technologies, **shiny** undoubtedly allows web-mapping applications to be developed in relatively few lines of code (86 in the case of CycleHireApp).
995+
Even if your applications are eventually deployed using different technologies, **shiny** undoubtedly allows web mapping applications to be developed in relatively few lines of code (86 in the case of CycleHireApp).
996996
That does not stop shiny apps getting rather large.
997997
The Propensity to Cycle Tool (PCT) hosted at [pct.bike](https://www.pct.bike/), for example, is a national mapping tool funded by the UK's Department for Transport.
998998
The PCT is used by dozens of people each day and has multiple interactive elements based on more than 1000 lines of [code](https://github.com/npct/pct-shiny/blob/master/regions_www/m/server.R) [@lovelace_propensity_2017].
@@ -1004,7 +1004,7 @@ This way your prototype web applications should be limited not by technical cons
10041004

10051005
<div class="figure" style="text-align: center">
10061006
<iframe src="https://shiny.robinlovelace.net/CycleHireApp/?showcase=0" width="690" height="400px" data-external="1"></iframe>
1007-
<p class="caption">(\#fig:CycleHireApp-html)CycleHireApp, a simple web-mapping application for finding the closest cycle hiring station based on your location and requirement of cycles. Interactive version available online at: r.geocompx.org.</p>
1007+
<p class="caption">(\#fig:CycleHireApp-html)CycleHireApp, a simple web mapping application for finding the closest cycle hiring station based on your location and requirement of cycles. Interactive version available online at: r.geocompx.org.</p>
10081008
</div>
10091009

10101010

@@ -1269,7 +1269,7 @@ E7. Create an interactive map of HDI in Africa:
12691269

12701270

12711271

1272-
E8. Sketch on paper ideas for a web-mapping application that could be used to make transport or land-use policies more evidence-based:
1272+
E8. Sketch on paper ideas for a web mapping application that could be used to make transport or land-use policies more evidence-based:
12731273

12741274
- In the city you live, for a couple of users per day
12751275
- In the country you live, for dozens of users per day

0 commit comments

Comments
 (0)