3 Diving In
There are plenty of github repositories explaining the different types of GIS and using R.
Below is the public google-my-maps
map that can be modified an worked on from within the window provided below.
{: .box-note}
Note: This can currently me modified and changed by anyone with the link. As it comes more important for the dataset to not be modified by others we will tighten this process up using the leaflet and shiny app process we are using for the mapping and analysis at the bottom of this post.
So far we have saved a leaflet
rmd
file as an html file and pasted it from the includes folder of the website. We will tighten this up too. :)
3.1 Downloading
To begin with check this is working in your local RStudio enviroment
Install the required packages. You need a recent version of the GDAL, GEOS, Proj.4, and UDUNITS libraries installed for this to work on Mac and Linux. More information on that at https://github.com/r-spatial/sf#installling.
Load the ones we need:
- In addition, it uses the following visualization packages:
- Check it’s all working, e.g. with this command:
And some blogging on the matter here.
There are plenty of github repositories explaining the different types of GIS and using R. Below is the public google-my-maps
map that can be modified an worked on from within the window provided below.
3.2 kml
to tidy
dataset
Import data from downloaded kml
file from the my-maps data.
- Download the
kml
file from online (NOT thekmz
file)
{.:Note} A KMZ
file is just a zipped KML
file, possibly with associated embedded images, icons, etc.
So any program that supports KMZ
files internally unzips them to access their KML files. That may be a reason why many open source programs do not bother supporting KMZ once KML support is implemented: you just need to use an additional unzipping library of your choice, to convert the KMZ to KML. The linked posts give some JavaScript-based solutions for unzipping.
## # A tibble: 12 x 7
## folder name description styleUrl longitude latitude altitude
## <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl>
## 1 Hollyford Gunns Camp <NA> #icon-1899-0… 168. -44.8 0
## 2 Hollyford Choqenout a… Eglinton Va… #icon-1899-0… 168. -45.1 0
## 3 Hollyford Hollyford V… <NA> #icon-1899-0… 168. -44.8 0
## 4 Hollyford Hollyford A… <NA> #icon-1899-0… 168. -44.7 0
## 5 Hollyford Point 9 <NA> #icon-1899-0… 168. -44.8 0
## 6 Hollyford Point 10 x = 10, y =… #icon-1899-0… 168. -44.9 0
## 7 Eglinton… MR1 <NA> #icon-1899-F… 168. -44.9 0
## 8 Eglinton… M1 <NA> #icon-1899-F… 168. -44.9 0
## 9 Eglinton… M1 <NA> #icon-1899-F… 168. -44.9 0
## 10 Eglinton… R1 <NA> #icon-1899-0… 168. -44.9 0
## 11 Eglinton… MR1 <NA> #icon-1899-F… 168. -44.9 0
## 12 Eglinton… R1 <NA> #icon-1899-0… 168. -44.9 0
3.2.1 Save
Save csv data for arcGIS work from here as: