Skip to content

Commit

Permalink
updates based on pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Verbesselt committed Dec 21, 2021
1 parent 340f890 commit 952e476
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 1 addition & 3 deletions index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,7 @@ plot(waterUTM, col = 'lightblue', add = TRUE, border = '#3A9AF0', lwd = 1) # u
```


Open [Google My Maps](https://www.google.com/maps/about/mymaps/), click *get started*, login on your Google account, create a new map by clicking on the *+* sign, name the map training_landcover, under *Untitled layer* click *Import* and find the KML file that you just created. You will see a rectangle of the study area appear on the map with the name *wagLandsatCropBbox*, click *Add layer*, name the new, untitled layer *landcover_points*, change the basemap to a satellite map, click *Add marker*, draw points on top of a few landcover types, and name the point as the land cover type. Keep your points within the bounding box (the *wagLandsatCropBbox* layer), otherwise they are out of the extent of the Landsat tile. Keep it to a few classes, such as `agriculture`, `forest`, `water`, `urban`. When you are done (15 - 30 points, with at least 5 points for each class), export the file to KML.

For the rest of the example, we'll use the `wagLandsatCrop` object, for we have a few doubts about the spatial accuracy of the two vector layers we used in the masking steps. You can check for yourself by converting them to KML and opening them in Google My Maps. (Let us know during the lesson, what do you think? Any solutions?) -->
<!-- Open [Google My Maps](https://www.google.com/maps/about/mymaps/), click *get started*, login on your Google account, create a new map by clicking on the *+* sign, name the map training_landcover, under *Untitled layer* click *Import* and find the KML file that you just created. You will see a rectangle of the study area appear on the map with the name *wagLandsatCropBbox*, click *Add layer*, name the new, untitled layer *landcover_points*, change the basemap to a satellite map, click *Add marker*, draw points on top of a few landcover types, and name the point as the land cover type. Keep your points within the bounding box (the *wagLandsatCropBbox* layer), otherwise they are out of the extent of the Landsat tile. Keep it to a few classes, such as `agriculture`, `forest`, `water`, `urban`. When you are done (15 - 30 points, with at least 5 points for each class), export the file to KML. -->



Expand Down
9 changes: 7 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1156,10 +1156,13 @@ <h2 id="prepare-the-data">Prepare the data</h2>
</button>
<pre style=""><code class="source r">if(!"raster" %in% rownames(installed.packages())){install.packages("raster")}
if(!"sf" %in% rownames(installed.packages())){install.packages("sf")}
if(!"rgeos" %in% rownames(installed.packages())){install.packages("rgeos")}
if (!dir.exists("data")) dir.create("data")

library(raster)
library(sf)
library(rgeos)

## Download, unzip and load the data
download.file(url = 'https://raw.githubusercontent.com/GeoScripting-WUR/VectorRaster/gh-pages/data/landsat8.zip', destfile = 'data/landsat8.zip', method = 'auto')

Expand Down Expand Up @@ -1363,7 +1366,7 @@ <h2 id="crop-mask-and-visualise">Crop, Mask and visualise</h2>
</div>
</div>
</div>
<!-- For the rest of the example, we'll use the `wagLandsatCrop` object, for we have a few doubts about the spatial accuracy of the two vector layers we used in the masking steps. You can check for yourself by converting them to KML and opening them in Google My Maps. (Let us know during the lesson, what do you think? Any solutions?) -->
<!-- Open [Google My Maps](https://www.google.com/maps/about/mymaps/), click *get started*, login on your Google account, create a new map by clicking on the *+* sign, name the map training_landcover, under *Untitled layer* click *Import* and find the KML file that you just created. You will see a rectangle of the study area appear on the map with the name *wagLandsatCropBbox*, click *Add layer*, name the new, untitled layer *landcover_points*, change the basemap to a satellite map, click *Add marker*, draw points on top of a few landcover types, and name the point as the land cover type. Keep your points within the bounding box (the *wagLandsatCropBbox* layer), otherwise they are out of the extent of the Landsat tile. Keep it to a few classes, such as `agriculture`, `forest`, `water`, `urban`. When you are done (15 - 30 points, with at least 5 points for each class), export the file to KML. -->
<div class="row">
<div class="alert alert-info">
<p>
Expand All @@ -1379,7 +1382,9 @@ <h2 id="crop-mask-and-visualise">Crop, Mask and visualise</h2>
<span class="glyphicon glyphicon-chevron-down"></span> R source
</button>
<pre style=""><code class="source r">## Try to export the simple feature to a KML. What happens? ps. The coordinate system of KML is geographic (latitude/longitude) on the World Geodetic System of 1984 (WGS84) datum.
try(st_write(water, dsn = "./data/water.kml"))</code></pre>
outKML <- c("./data/water.kml")
try(st_write(water, outKML, driver = "kml", delete_dsn = ifelse(file.exists(outKML),TRUE,FALSE))
## checks for existence of KML file and sets the delete_dsn option to true or false accordingly</code></pre>
</div>
<div class="row">
<div class="alert alert-info">
Expand Down

0 comments on commit 952e476

Please sign in to comment.