File:Kyllikki saari murder site minimum cost certain cost distance negative exponential ring 1 1 1 1.png
![File:Kyllikki saari murder site minimum cost certain cost distance negative exponential ring 1 1 1 1.png](https://upload.wikimedia.org/wikipedia/commons/thumb/6/6d/Kyllikki_saari_murder_site_minimum_cost_certain_cost_distance_negative_exponential_ring_1_1_1_1.png/736px-Kyllikki_saari_murder_site_minimum_cost_certain_cost_distance_negative_exponential_ring_1_1_1_1.png?20230828165010)
Original file (750 × 611 pixels, file size: 178 KB, MIME type: image/png)
Captions
Captions
Summary
[edit]DescriptionKyllikki saari murder site minimum cost certain cost distance negative exponential ring 1 1 1 1.png |
English: Kyllikki Saari murder site minimum cost certain cost distance negative exponential ring. Ring maximum adjusted to bike. |
Date | |
Source | Own work |
Author | Merikanto |
Camera location | 62° 08′ 58.71″ N, 21° 57′ 26.9″ E ![]() ![]() | View this and other nearby images on: OpenStreetMap | ![]() |
---|
This image uses OpenStreetMap
Open Database Licence
https://www.openstreetmap.org/copyright
"R" script to calculate raster from distance raster.
Distence raster must done separately with QGIS etc utility
"R 4.3.1 script
library(raster)
library(movecost)
library(sp)
library(leaflet)
library(htmlwidgets)
library(mapview)
library(utils)
library("webshot")
- webshot::install_phantomjs()
conduk1=2
ratius1=0.5 ## radius of maximum
rcoeff1=0.33 # exponet function concentration
distcoeff1=50
outPath = paste("./", "leaflethtmlgen.html", sep="")
lok1 <- SpatialPoints( rbind(c(21.95747269428545, 62.149641560706669 ) )) ## hauta
lok2 <- SpatialPoints( rbind(c(21.957268833940159, 62.133740877230359) )) ## pyörä
pai1 <- SpatialPointsDataFrame(lok1, data.frame(row.names=row.names(lok1),
ID=1:length(lok1)))
pai2 <- SpatialPointsDataFrame(lok2, data.frame(row.names=row.names(lok2),
ID=1:length(lok2)))
dtm1<-raster("distancer.tif")
dtm1<-dtm1*conduk1
result <- movecost(dtm=dtm1, origin=pai1, destin=pai2, move=8, breaks=0.05)
- print (str(result))
plot(result$cost.surface)
plot(result$accumulated.cost.raster)
r2<-result$cost.surface
crs(r2) <- "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"
writeRaster(r2, "costsurf", format = "GTiff", overwrite=TRUE)
r2<-result$accumulated.cost.raster
crs(r2) <- "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"
writeRaster(r2, "accost", format = "GTiff", overwrite=TRUE)
- distcoeff1=20 ## to pyörä/2
r3=r2-ratius1
- r3=dnorm(r3, 0, .5)
- r3=sin(r3*5)
r3=1*exp(-abs(r3*rcoeff1))
distexp1=exp(-dtm1/distcoeff1)
plot(distexp1)
r4=r3*distexp1
plot(r3)
writeRaster(r3, "ring0", format = "GTiff", overwrite=TRUE)
plot(r4)
writeRaster(r4, "distring0", format = "GTiff", overwrite=TRUE)
m <- leaflet() %>%
addTiles() %>%
setView(lng=21.95747269428545, lat=62.149641560706669, zoom =12)%>%
addMarkers(lng=21.95747269428545, lat=62.149641560706669, popup="Hauta") %>%
addMarkers(lng=21.957268833940159, lat=62.133740877230359, popup="Pyörä") %>%
addRasterImage(r3,opacity = 0.5)
m
saveWidget(m, file = outPath, selfcontained = FALSE, libdir = 'leafletwidget_libs')
- html_fl = tempfile(fileext = ".html")
- png_fl = tempfile(fileext = ".png")
## create standalone .html
- mapshot(m, url = "./out.html")
- browseURL(html_fl)
## create standalone .png; temporary .html is removed automatically unless
## 'remove_url = FALSE' is specified
mapshot(m, file ="./out.png", selfcontained=FALSE)
- browseURL(png_fl)
Licensing
[edit]![w:en:Creative Commons](https://upload.wikimedia.org/wikipedia/commons/thumb/7/79/CC_some_rights_reserved.svg/90px-CC_some_rights_reserved.svg.png)
![attribution](https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Cc-by_new_white.svg/24px-Cc-by_new_white.svg.png)
![share alike](https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Cc-sa_white.svg/24px-Cc-sa_white.svg.png)
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 16:50, 28 August 2023 | ![]() | 750 × 611 (178 KB) | Merikanto (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.