Skip to content
Snippets Groups Projects
Commit 89992230 authored by Nicolas Lambert's avatar Nicolas Lambert
Browse files

toplight

parent 337e2094
No related branches found
No related tags found
No related merge requests found
Pipeline #5794 passed
# Packages
library(sf)
library(raster)
library(sp)
library(tiff)
prj <- "+proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"
fact <- 100
dem <- raster("ETOPO1_Ice_g_geotiff.tif")
dem <- aggregate(dem, fact=fact, fun=max)
dots <- as(dem, 'SpatialPointsDataFrame')
dots <- st_as_sf(dots)
dots <- dots[dots$ETOPO1_Ice_g_geotiff > 0,]
coords <- as.data.frame(st_coordinates(dots))
dots$X <- coords$X
dots$Y <- coords$Y
plot(st_geometry(dots))
write.csv(dots, 'ETOPO1_light.csv')
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment