Debian Codegraph @

R/Class-SpatialPoints.R

raw
1 setClass("SpatialPoints",
2 contains = "Spatial",
3 slots = c(coords = "matrix"),
4 prototype = list(bbox = matrix(NA),
5 proj4string = CRS(as.character(NA)),
6 coords = matrix(0)),
7 validity = function(object) {
8 if (!is.matrix(object@coords))
9 return("coords slot is not a matrix")
10 if (ncol(object@coords) < 2)
11 return("SpatialPoints: too few coordinate columns")
12 if (!is.double(object@coords[,1]))
13 return("coordinates should be double")
14 rowNames = dimnames(object@coords)[[1]]
15 if (!is.null(rowNames) && anyDuplicated(rowNames))
16 warning("duplicate rownames are interpreted by rgeos as MultiPoints; use SpatialMultiPoints to define these; in future sp versions this warning will become an error")
17 return(TRUE)
18 }
19 )