Displaying 14 results from an estimated 14 matches for "spatiallin".
Did you mean:
spatialline
2017 Sep 25
0
build a SpatialLines object from a list
Hi Ashraf,
It is not obvious to me what your structures are but one problem in your
function is the assignment tt1 <- SpatialLines(list(tt[[i]])).
This will set tt1 to just have one item.
Consider the following
test.func <- function(x) {
tt1 <- list()
for ( i in ... ) {
...
tt1[[i]] <- SpatialLines(tt[[i]])
}
return(tt1)
}
HTH,
Eric
On Mon, Sep 25, 2017 at 3:40 PM, Ashraf Afana v...
2017 Sep 26
2
build a SpatialLines object from a list
Hi Eric,
Thanks for the help.But this will not solve the problem as it will generate a list and what I need is an object of class sp using SpatialLine function from sp package.So, I need to convert each matrix to coordinates and then to a line and then to a spatial line as figured in the code.
My data structure is a list of 141 matrices.Each matrix represents coordinates of the river lines position.
Ashraf, cheers
On Monday, 25 September...
2017 Sep 25
2
build a SpatialLines object from a list
Hi all,I'm trying to build a SpatialLines object from a list that contains 124 river segments. Each segment in the list contains the x,y coordinates. I'm using the following code to create the SpatialLines object, but it just retrieves one segment. Any suggestions?
test.func = function(x){
??? for (i in 1:length(x)) {??????? tt[[i]...
2017 Sep 26
0
build a SpatialLines object from a list
Hi Ashraf,
In that case I think you may need to structure the code to first build the
list and only at the end supply that to the SpatialLines function,
something like
test.func <- function(x) {
tt <- list()
for ( i in ... ) {
...
tt[[i]] <- (whatever)
}
return(SpatialLines(tt))
}
Eric
On Tue, Sep 26, 2017 at 12:36 PM, Ashraf Afana <asafaneh at yahoo.com> wrote:
> Hi Eric,
>
>...
2011 Oct 26
2
SpatialLines
I'm hoping to use R for spatial analysis. In working through examples in Chapt. 4 of Applied Spatial Data Analysis with R I've come across the following error in trying to plot lines with the meuse data set. The text is verbatim from the book.
> m.sl <- SpatialLines(list(Lines(list(Line(cc)))))
Error in Lines(list(Line(cc))) : Single ID required
What does "Single ID required" mean?
Thanks.
Mark
2009 Jul 14
1
Error when sampling from SpatialLines
Dear forum,
I am working in R 2.9.1 and I am trying to sample locations from a network file. Reading in nor plotting is a problem, however when I am trying to sample from the file I get the following message:
nwlim<-readShapeLines("C:/Limburg_nwshape", proj4string=CRS("+init=epsg:31300"))
plot(nwlim)
randacc<-spsample(nwlim,n=1000,"random")
2013 Apr 26
1
[newbie] how to find and combine geographic maps with particular features?
...lt;- map.lines.coords.IOAPI.x + extents.xmin
> map.IOAPI$y <- map.lines.coords.IOAPI.y + extents.ymin
> map.IOAPI$range <- c(
> min(map.IOAPI$x),
> max(map.IOAPI$x),
> min(map.IOAPI$y),
> max(map.IOAPI$y))
> map.IOAPI.shp <-
> maptools::map2SpatialLines(map.IOAPI, proj4string=CRS)
> return(map.IOAPI.shp)
> } # end project.M3.boundaries.for.CMAQ
The maps are then overlaid on data and plotted using package=rasterVis
http://cran.r-project.org/web/packages/rasterVis/
with code like
https://bitbucket.org/tlroche/gfed-3.1_global_to_aqmeii...
2010 Nov 26
1
Generating kml lines output
Dear,
I would like to generate kml file with lines (<LineString>) of
different style (definitely color, but width would also be nice to
see). However with kmlLine from maptools package I am able only to
output the single first Lines object (first row of
SpatialLinesDataFrame)
I guess the option would be to have single Lines object (instead of
list of them), but then also the style wouldn't vary among them... My
code so far:
library(maptools)
library(sp)
out <- structure(list(I = structure(c(1L, 7L, 3L, 4L, 5L, 1L, 2L, 9L,
6L, 3L,
10L, 8...
2011 Jul 06
3
finding the intersection of two vectors
Hi,
Suppose I have two vectors, not necessarily the same length (in fact,
they usually are different lengths): y.1 that has increasing values
between 0 and 1; y.2 that has decreasing values between 1.0 and 0. You
can picture these as being supply (= y.1) and demand (= y.2) curves from
economics. I typically plot these vectors on the same graph against a
common x variable, which happens to
2009 Nov 18
0
Effective measurement of point-polygon distance
...the data frame in an efficient manner.
I am thinking of something like a double for-loop, but can't get it to work.
I am also having problems reproducing my list of spatial polygons in a
simple way here, but hope that my explanation is sufficient.
# Making two test areas:
library(sp)
w1 <- SpatialLines(list(Lines(list(Line(cbind(
c(80,85,87,90,85,80),
c(10,15,17,15,10,10)
))))))
w2 <- SpatialLines(list(Lines(list(Line(cbind(
c(65,67,76,68,65),
c(30,29,24,22,30)
))))))
# Test points:
x = c(5, 7, 35, 28)
y = c(60, 70, 90, 85)
xy <- SpatialPoints(cbind(y,x))
distance <- rep(NA, 4)
for...
2011 Jan 05
1
Prediction error for Ordinary Kriging
...(cbind(x2$X, x2$Y))
v <- variogram(log1p(tsport_ace) ~ 1, x2, cutoff=100, width=9)
te<- fit.variogram(v,vgm(0.0437, "Exp", 26, 0))
y <- krige(tsport_ace~1, x2, x2_SG, model = ve.fit)
spplot(y, 1, col.regions = bpy.colors(100), sp.layout = list("sp.lines",as(rsa2,
"SpatialLines"),no.clip = TRUE))
I'm looking forward to your response. Thanks.
Best regards,
Pearl dela Cruz
[[alternative HTML version deleted]]
2016 Apr 28
0
Snowfall - Error in checkForRemoteErrors(val) with sfClusterApplyLB()
...sfLibrary(rgeos)
sfLibrary(snowfall)
system.time( sfClusterApplyLB(1:10, function(k) {
sfCat(paste("Iteration ", k), sep="\n")
if (......) {
} else {
if (class(ob1)=="SpatialCollections") {
ob2 <- ob1 at lineobj
} else if (class(ob1)=="SpatialLines") {
ob2 <- ob1
}
ob3 <- data.frame(length_m=sapply(1:length(ob2), function(l) gLength(ob2 [l, ])))
.....
}
.....
}
sfStop()
The problem is that the code returns the error message:
Error in checkForRemoteErrors(val) :
one node produced an error: object '...
2011 Jul 13
3
adding text to spplot
hi all,
I have a plot to which i would like to add text labels. And i cant find a way...here is the code :
enaD2<-idw(D2~1, loca=dva, newdata=grd)
pts = list("sp.points", dva, pch = 20, cex=1.5, col = "darkred
spplot(enaD2, "var1.pred",sp.layout=pts, main = "globina 60 cm", sub="D2",
2009 Jun 29
5
Help
Hi group,
I found a module for adaptive kernel density estimation for Stata users, but unfortunetly I don't have access to Stata, can I find a similar approach using R?
Thank u so much 4 ur time.
[[alternative HTML version deleted]]