similar to: Error when sampling from SpatialLines

Displaying 20 results from an estimated 100 matches similar to: "Error when sampling from SpatialLines"

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
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]] <- x[i]; tt[[i]]? = Line(tt[[i]]); tt[[i]]? =
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
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 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
2007 Oct 15
1
Distance matrix in SpDep-package
Hello everybody, I would like to use the SpDep-package (especially the Local Moran index analysis and the Getis-Ord statistics) in R for analysing my data. However, I don't have x-y coordinates, but my data is in a distance matrix format. Is it possible to use the SpDep package with predefined distances as well instead of letting the program determining the distance itself by the function
2008 May 13
2
Permutations
Dear R-users, Is there an easy way to determine all possible vectors of length 21 with each entry having permutations from 0 to 4, instead of doing it like this? It really takes up too much time, and I am convinced that there exists something easier. Can you help me? Thank you in advance! Kind regards, Elke for (a in 0:4){ for (b in 0:4){ for (c in 0:4){ for (d in 0:4){
2009 Nov 18
0
Effective measurement of point-polygon distance
Dear list I have two datasets, one with a large number of point coordinates, the other with spatial polygons. I want to measure the shortest distance from each point to the border of all polygons, and then store the results as a column in a data frame. (Or a vector that can be turned into a column in a data frame). The points and polygons represent different types of events, happening at
2008 Feb 17
1
random location in polygons sp spsample splancs csr
Dear all, I had to place points at random, one in each of larger number of polygons (actually in objects of class 'SpatialPolygonsDataFrame' , see sp library), and tried first to do it using spsample (from sp). Surprisingly, every 5-15 trials, the output was a NULL value. The doc says that ' this may occur when trying to hit a small and awkwardly shaped polygon in a large
2013 Apr 26
1
[newbie] how to find and combine geographic maps with particular features?
SUMMARY: Specific problem: I'm regridding biomass-burning emissions from a global/unprojected inventory to a regional projection (LCC over North America). I need to have boundaries for Canada, Mexico, and US (including US states), but also Caribbean and Atlantic nations (notably the Bahamas). I would also like to add Canadian provinces and Mexican states. How to put these together? General
2014 Oct 08
2
Pregunta sobre manipulación de shapefile
Oscar, al final no he podido esperar hasta mañana Con: library(maptools)library(sp) poligonos <- readShapeLines("C:\\...\\DATOS\\MUNICIPIO.shp") sink("C:\\ ... \\DATOS\\MUNICIPIO.csv") coordinates(poligonos) Consigo un fichero con la suficiente estructura para tratarlo fácilmente y de una tacada montar la tabla .csv tal y como he indicado en un correo anterior Necesito el
2017 Nov 13
2
Convert poly line to polygon in R
I have a shape file as poly line and I want to convert it to polygon.Is it possible to do that in R?lake <-readShapeLines("./lake_main_utm.shp")proj4string(lake) <- CRS("+proj=utm +zone=39 +datum=WGS84") Sincerely. [[alternative HTML version deleted]]
2009 Jun 20
3
omindex hangs while scanning
Hello, I was looking for a search engine for a small internal documentation site and found xapian and omega. Downloaded and compiled it using msys and ming on a german windows xp system. Finally installed apache on the same box. Following the omega example I copied the book to .../apache/htdocs and startet the omindex which hang up on the first document found. Even on very short doc with
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
2014 Oct 08
4
Pregunta sobre manipulación de shapefile
Gracias Beatriz, efectivamente, lo que indicas en tu ejemplo es lo que obtengo al final de mi proceso. En todo caso pruebo tu opción con mis datos, si es como imagino seguro que es más rápida de montar y más elegante que tratar el resultado de un sink() (recuerdo que en su momento lo intenté con fotify pero no supe bien como atacarlo, no conocía el enlace que me mandas, por tanto lo pruebo de
2010 Oct 12
0
Stripes in the plot
I'm trying to plot the spatial distribution of the precipitation within an area. However, I think some thing wrong with the way to create the matrix for the precipitation data, so it came out lots of stripes. Could somebody help to see what's the problem? Here's the code: library(maptools);gpclibPermit() KSR <-
2017 Nov 13
0
Convert poly line to polygon in R
Might want to post this on R-sig-geo. Might also want to post in plain text format... see below how your message got messed up coming through the mailing list. -- Sent from my phone. Please excuse my brevity. On November 12, 2017 9:58:56 PM PST, Javad Bayat via R-help <r-help at r-project.org> wrote: >I have a shape file as poly line and I want to convert it to polygon.Is >it
2014 Oct 08
3
Pregunta sobre manipulación de shapefile
Hola buenos días: Hace algún tiempo mandé una duda que sobre fichero tipo shapefile que publica el Instituto Geográfico Nacional de España y que detallo en el word Duda_sobre_shp. El tema es que al final no obtuve respuesta (es cierto que lo mandé en Agosto y en esa fechas entiendo que sea normal, por tanto por recomendación de un conocido vuelvo de nuevo a remitir la cuestión) Como no podía
2007 Dec 17
1
polygon class in splancs package
Dear forum, I would like to use the kernel2d or spkernel2d in the Splancs-package, but it does not recognize my polygon data. "Error in kernel2d(as.points(ptsbin), polygonprov, h0 = 2, nx = 100, : " is the error message. Invalid poly argument The data are defined as follows: polgonprov<-list(x=polyprov$X, y=polyprov$Y) with X and Y coordinates in the Lambert1972
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