-
Notifications
You must be signed in to change notification settings - Fork 0
/
Arvores app 28 Aug 2022.Rmd
58 lines (40 loc) · 1.13 KB
/
Arvores app 28 Aug 2022.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
title: "App - Aug 28 2022"
author: "Gabriel Santos"
date: '2022-08-28'
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r include=FALSE, message=FALSE, warning=FALSE}
library(tidyverse)
library(leaflet)
library(leaflet.extras)
library(rgdal)
```
```{r include=FALSE, message=FALSE, warning=FALSE}
Arvores<-rgdal::readOGR(
dsn = getwd(),
layer = "arvores")
```
```{r include=FALSE, message=FALSE, warning=FALSE}
#Convert SIRGAS para WGS
Arvores<-spTransform(Arvores,CRS("+proj=longlat"))
```
```{r include=FALSE, message=FALSE, warning=FALSE}
centroids<-rgeos::gCentroid(Arvores,byid=TRUE)
Arvores<-cbind(Arvores@data,centroids)
```
```{r echo=FALSE}
map<-leaflet(Arvores)%>%
addMiniMap()%>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lng = ~x, lat = ~y,
clusterOptions = markerClusterOptions())
map <- addControlGPS(map, options = gpsOptions(position = "topleft", activate = TRUE,
autoCenter = TRUE, maxZoom = 10,
setView = TRUE))
map
activateGPS(map)
```