An Interactive Temperature Prediction Map : Central Gothenburg City : Rstudio + Mapview + Raster
An Interactive Temperature Prediction Map : Central Gothenburg City : Rstudio + Mapview + Raster
- 1 Load CentralaGBG.shp file
- 2 Import csv file and view data structure
- 3 Create spatial object
- 4 Interactive Actual Temperature Map : Central Gothenburg City
- 5 IDW interpolation
- 6 Create an empty grid of values ranging from the xmin-xmax, ymin-ymax
- 7 Set CRS to shape file
- 8 Interactive Temperature Prediction Map : Central Gothenburg City
1 Load CentralaGBG.shp file
## OGR data source with driver: ESRI Shapefile
## Source: "C:\Users\Heatfront\Desktop\blibtexfolder\javainRstdio\CentralaGBG\CentralaGBG.shp", layer: "CentralaGBG"
## with 8534 features
## It has 8 fields
## Warning in readOGR("CentralaGBG/CentralaGBG.shp"): Z-dimension discarded
## CRS arguments: NA
## class : Extent
## xmin : 38550
## xmax : 39950
## ymin : 27443
## ymax : 28843
2 Import csv file and view data structure
Temperatur22APRIL =read.csv("CentralaGBG/Temperatur22APRIL.txt", header=T,sep="\t")
str(Temperatur22APRIL)## 'data.frame': 57 obs. of 3 variables:
## $ X : int 39477 39425 39332 39260 39405 39521 39554 39640 39716 39747 ...
## $ Y : int 27543 27588 27678 27830 27874 27902 27809 27819 27899 27977 ...
## $ Temperatur: num 11.1 11 10.8 11.1 11.5 ...
## [1] "data.frame"
3 Create spatial object
## [1] "SpatialPointsDataFrame"
## attr(,"package")
## [1] "sp"