fishnet: Generatue fishnet 'fishnet' Generate fishnet by the...

View source: R/Func_GIS.R

fishnetR Documentation

Generatue fishnet fishnet Generate fishnet by the coordinates

Description

Generatue fishnet fishnet Generate fishnet by the coordinates

Usage

fishnet(xx, yy, crs = sp::CRS("+init=epsg:4326"), type = "polygon")

Arguments

xx

x coordinates

yy

y coordinates

crs

projections parameters, defaul = epsg:4326

type

option = 'polygon', 'points', 'line'

Value

spatildata (.shp)

Examples

library(raster)
ext=c(0, 8, 2, 10)
dx = 2; dy = 4
xx=seq(ext[1], ext[2], by=dx)
yy=seq(ext[3], ext[4], by=dy)
sp1 =fishnet(xx=ext[1:2], yy=ext[3:4])
sp2 =fishnet(xx=xx + .5 * dx, yy=yy + 0.5 * dy)
sp3 =fishnet(xx=xx, yy=yy, type = 'point')
plot(sp1, axes=TRUE, xlim=c(-1, 1)*dx +ext[1:2], ylim=c(-1, 1)*dy + ext[3:4])
plot(sp2, axes=TRUE, add=TRUE, border=2)
plot(sp3, axes=TRUE, add=TRUE, col=3, pch=20)
grid()

SHUD-System/SHUDtoolbox documentation built on Nov. 27, 2024, 5:54 a.m.