search for: spdf

Displaying 20 results from an estimated 20 matches for "spdf".

Did you mean: pdf
2012 Sep 24
2
Latitude Longitude to SPDF
Hi Team, Need your guidance in building SPDF objects from Latitude, Longitude Information available. I am using package "plotGoogleMaps" which is really awesome but it requires SPDF objects to build the maps. I have a data frame which have Latitude and Longitude information and wanted to convert it in SPDF for making maps. Please h...
2012 Aug 13
1
Fine Tuning Country Map
...ChangePrefix <- function (fileName, level = 0, ...) { theFile <- loadGADM(fileName, level) theFile <- changeGADMPrefix(theFile, fileName) theFile } ## this function creates a SpatialPolygonsDataFrame that contains all maps you specify in "fileNames". ## E.g.: ## spdf <- getCountries(c("ARG","BOL","CHL")) ## plot(spdf) # should draw a map with Brasil, Argentina and Chile on it. getCountries <- function (fileNames, level = 0, ...) { polygon <- sapply(fileNames, loadChangePrefix, level) polyMap <- do.call("r...
2012 Apr 23
2
automating a script to read a file
...device to capture the plots to do this, but my R programming skills are too limited to determine how to best accomplish this. If any one can provide assistance I would appreciate the help. Thanks, Steve ## Function set to find values in a skewed normal distribution print("syntax: plot.spdf(min, max, skewlocation, skewscale, skewshape, skewmax, <skewtitle>)") flush.console() # sample input data could be the following: # -100, 1000, 976.02, 230, -34, 0.7543 # 0, 500, 270, 350, -13, 0.7707 # or any other data of similar form erf <- function(z) {...
2013 Jan 04
1
SpatialPolygon with the max value gets no color assigned in spplot function when using "at" parameter
Hi, I would like to do coloring of map regions based on the region values "weight". The approach I am taking is first to break regions into equal intervals, classIntervals(spdf$weight,4)$brks #4 intervals in this case and coloring all regions within the interval with the same color col = brewer.pal(4,"RdYlGn")) The max "weight" is as well the boundary of the interval The problem is that the last region is not included into the last interval nad has...
2013 Nov 27
0
GADM Data Download
...ChangePrefix <- function (fileName, level = 0, ...) { theFile <- loadGADM(fileName, level) theFile <- changeGADMPrefix(theFile, fileName) theFile } ## this function creates a SpatialPolygonsDataFrame that contains all maps you specify in "fileNames". ## E.g.: ## spdf <- getCountries(c("ARG","BOL","CHL")) ## plot(spdf) # should draw a map with Brasil, Argentina and Chile on it. getCountries <- function (fileNames, level = 0, ...) { polygon <- sapply(fileNames, loadChangePrefix, level) polyMap <- do.call("r...
2009 Aug 30
1
Trying to rename spatial pts data frame slot that isn't a slot()
...orted to qGIS for manipulations. At this point the ID names were lost. I brought the manipulated shapefiles back into qGIS, but can't figure out how to rename the individuals. #Calculate MCP and save as a shapefile my.mcp<-mcp(xy, id=id, percent=100) spol<-area2spol(my.mcp) spdf <- SpatialPolygonsDataFrame(spol, data=data.frame +(getSpPPolygonsLabptSlots(spol), +row.names=getSpPPolygonsIDSlots(spol)), match.ID = TRUE) writeOGR(spdf,dsn=mcp.dir,layer="All Mantas MCP", driver="ESRI +Shapefile") #Read shapefile manipulated i...
2015 Aug 04
2
Duda interpolación (package ' gstat ')
Hola, # Hacemos el KED. Ver función "krige()": KED.rad <- krige( formula=pluvPcp~layer, # covariable -> radar locations=lluvia.rad.pluv.spdf, newdata=radarGrid, # podría ser cualquier objeto Spatial model=v.fit, # modelo de semivariograma. maxdist=Inf ) Esta es la función que me interpola los datos de lluvia. El error que me da es: "solve.c&quo...
2017 Nov 23
0
How to produce rainfall maps
Thank you Sarah and Mike for your explanations. My final objective is to produce maps (png image or any kind of extension I can import in LaTeX) where rainfall data are interpolated, using the Inverse Distance method or Kriging. My input file (pointfile.csv in the reported example) reports the station code, lat and long of the meteorological station and the rainfall value (which might be the
2017 May 12
1
spTransform
Salutations, Long story short: I need to create an SPDF to superimpose on a Google map. I have .shp file which has a long list of locations listed in (what I guess must be) UTM. I need to transform these into lon, lat. My use of spTransform, however, keeps giving me the wrong results. For what it's worth, it only seems to be messing up the latitude...
2009 Jul 10
2
while( ) to get a vector until the sum of elements are <= X ?
I have a vector of values X = seq(1:10) I want to get another vector V of with sample (with replacement) of X but with a constrain: V will have as much elements as those necessary to V sum exactly 10. If the N-th value of V make the sum greater than 10, it's is subtracted with the difference to achieve the constrain. I don't know how to achieve this. with a while?
2006 Jan 07
1
maptools, write.polylistShape
Dear Roger, I am trying to use the write.polylistShape() function of maptools for the first time and realize that it handles list of polygons of class 'polylist'. However, it seems that no as.polylist() function exist in the package. The question behind that is: in your opinion, which would be the best way to convert a list of matrix of polygon nodes coordinates into an object of
2012 Jul 20
1
Dissolve polygon
Hi, I am working with a SpatialPolygonsDataFrame of many islands. There are a lot of polygons (islands) composing my SpatialPolygonsDataFrame. I want to extract the elevation of each island. I need to separate the different polygons (like dissolve function in arcgis), to have the elevation of each island. Do you have any idea how can I do that ? I already read a lot of forum, and read the
2017 Oct 11
1
Iterate in a Spatial Polygon Dataframe in R?
Hi all, ?I'm trying to iterate in a SpatialPolygonDataFrame thatcontains 110 features. I tried to use the following code? iterate.spdf =function(x){ for (i in 1:nrow(x)){ p = x[i, ]} return(p)} but with no success as it returns with aSpatialPolygonDataFrame that contains onlyone feature. The code seems to overwrite the polygons to end up with only onefeature. ?Any suggestions?Ashraf, cheers [[alternative HTML version deleted]]
2009 Dec 11
3
Please help with a basic function
Hello, I am learning how to use functions, but I'm running into a roadblock. I would like my function to do two things: 1) convert an object to a dataframe, 2) and then subset the dataframe. Both of these commands work fine outside the function, but I would like to wrap them in a function so I can apply the code iteratively to many such objects. Here's what I wrote, but it doesn't
2015 Aug 06
2
Duda interpolación (package ' gstat ')
...las 11:24, Marcos Bermejo escribió: > > Hola, > > > > # Hacemos el KED. Ver funci?n "krige()": > > KED.rad <- krige( > > formula=pluvPcp~layer, # covariable -> radar > > locations=lluvia.rad.pluv.spdf, > > newdata=radarGrid, # podr?a ser cualquier objeto Spatial > > model=v.fit, # modelo de semivariograma. > > maxdist=Inf > > ) > > > > Esta es la funci?n que me interpola...
2017 Nov 22
2
How to produce rainfall maps
Fwiw the engine behind geom_raster needs explicit observation-per-row form for input (with no structural normalization), so conversion to points is perfectly proper here, albeit confusing in context. (It's closer to what graphics devices actually use ultimately, but the expansion is laid out very early in ggplot2 because there's no standard for intermediate forms.) Cheers, Mike On Wed,
2014 Jun 15
0
Problem with converting a list of grids to a list of polygons
...t it, how can I read data of this format as a list of polygons? ?head"(ID, XMIN, XMAX, YMIN, YMAX, lat, lng, altc_mean) polys <- Polygons(list(Polygon(assemblage[,c("XMIN", "XMAX", "YMIN", "YMAX?)])), ID=assemblage$ID) SP <- SpatialPolygons(polys) SPDF <- SpatialPolygonsDataFrame(SP, data=data.frame(x= assemblage$lng, y= assemblage$lat, row.names=row.names(SP))) Already thanks for your help, Stefan -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-converting-a-list-of-grids-to-a-list-of-polygons-tp46...
2010 May 06
1
extracting coordinates from SpatialPolygonsDataFrame using slot functions
In converting some older code: ## builds an OWIN to generate a set of points on a grid within the OWIN object: bdry <- read.shape( "../../data/boundary.shp" ) outline.verts <- bdry$Shapes[[2]]$verts[1:bdry$Shapes[[2]]$Pstart[2],] outline.order <- nrow( outline.verts ) : 2 bdry.poly <- vector( 2, mode="list" ) bdry.poly[[1]] <- list(
2009 Sep 01
1
Logistic Politomic Regression in R
...orted to qGIS for manipulations.  At this point the ID names were lost.  I brought the manipulated shapefiles back into qGIS, but can't figure out how to rename the individuals. #Calculate MCP and save as a shapefile     my.mcp<-mcp(xy, id=id, percent=100)     spol<-area2spol(my.mcp)     spdf <- SpatialPolygonsDataFrame(spol, data=data.frame         +(getSpPPolygonsLabptSlots(spol),         +row.names=getSpPPolygonsIDSlots(spol)), match.ID = TRUE)     writeOGR(spdf,dsn=mcp.dir,layer="All Mantas MCP", driver="ESRI         +Shapefile") #Read shapefile manipulated i...
2008 May 05
3
troubles with R CMD check and examples under Ubuntu gutsy
Dear listers, I was used to package pgirmess under Windows with everything OK, but, for the first time, I had a trial this afternoon on Ubuntu 7.10 gutsy (I have a double boot computer and work more and more under unix) and R 2.7.0. Everything went OK except this: sudo R CMD check pgirmess ..... * checking examples ... ERROR Running examples in 'pgirmess-Ex.R' failed. The error most