Displaying 20 results from an estimated 1200 matches similar to: "how to get points from SpatialPolygonsDataFrame"
2011 Jul 09
1
SpatialPolygonsDataFrame holes problem
I have obtained shapefiles for Indian states from here:
http://www.maptell.com/index.php?option=com_remository&Itemid=159&func=fileinfo&filecatid=115&parent=category
Problem: I want to extract centroid coordinates for each State, but there is some coding problem with the shapefiles that prevents this.
#Code:
#After extracting the shapefiles from the india_state.zip file, then:
2009 Mar 21
3
Retrieving Vertices Coordinates from SpatialPolygons
Dear List,
I'm trying to use different R packages for my Teaching Assistantship
classes. And I cam out to an (apparently) very simple problem. I would
like to retrieve the vertices coordinate of a SpatialPolygon data. I
know this is stored in the "coords" slot, but I can't get access to
it! I tried to coerce the SpatialPolygon into a data.frame but it
doesn't work.
2009 Aug 14
1
extract data from shapefiles
I'm hoping that someone could guide me in how to extract data from shapefiles. I want to extract data from a shapefile (classed as "SpatialPolygonsDataFrame") and more specifically, the data is contained within the slot called "coords" from the class "polygons" within this file and despite my best efforts (and much reading!), I'm at a lost.
Many thanks,
Kate
2006 Dec 30
1
plot methods in sp
Dear listers,
I am working since a while with the sp package and still wonder how the
plot methods are managed with sp spatial objects. For instance,
SpatialPolygonsDataFrame objects have obviously a plot method. However
it cannot be found in the list provided by methods(plot) . Furthermore
?plot.SpatialPolygonsDataFrame, nor ?plot.SpatialPolygons, etc.. provide
a help, though the lattice
2006 Oct 07
3
merge and polylist
Greetings:
I would like to kindly ask for a little help. The rough code is:
#________________________________________________________
dat=data.frame(read.delim(file="all.txt", header = TRUE, sep = "\t",
quote="\"", dec=".",na.strings = "NA"))
nc=read.shape("astae.shp", dbf.data=TRUE, verbose=TRUE)
mappolys=Map2poly(nc)
submap
2018 Jun 01
1
rasterize SpatialPolygon object using a RasterBrick object
I am trying to rasterize a SpatialPolygon object by a RasterBrick object.
The documentation of the raster::rasterize function explicitly says this is
allowed. Here's what I am doing
# load the raster package
library("raster")
# create a raster brick object using the example from the brick
function documentation
b <- brick(system.file("external/rlogo.grd",
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
2007 Sep 05
1
geotiff or tiff files with world files
Hi,
I have a matrix of data which i can vizualize as an image - for example. I would like to save this image as a geotiff file or at a tiff file with a world file which holds the projection of my data (ultimately the data represent a map of some sort). I know i can save the data as an ESRI grid, but i am not interested in that.
I wonder if anybody knows about any code which will help me do
2007 Dec 12
1
How to plot the grid figure using R?
Now I have the forest plot data with x, y locations, and I measured the DBH for every indivicuals.
The data looks like that:
x=runif(100,0,100)
y=runif(100,0,100)
dbh=runif(100,1,100)
rdata=data.frame(x,y,dbh)
> rdata[1:5,]
x y dbh
1 99.5354145 1.412844 34.10112
2 0.8259361 87.737036 39.12914
3 6.5678613 65.699032 22.55990
4 67.2987881 72.053877 45.83978
5 2.2491372
2005 Nov 17
8
Point pattern to grid
Dear all,
I'd like to change a point pattern to a grid of cells and use one of the variables as the output.
e.g. The point pattern is of a window of (500*500) and several features such as pH, SoilType etc. I like to divide it into a grid with cell size 5*5, and use the mean of the point values falling inside the cell as the output.
Is there any package in R working with this? Thanks in
2007 May 04
1
Help with map
I have just learned how to play with map, but something weird
(or not) is happening.
Suppose I want to draw a map of two countries (that have disconnected
components), like Argentina and Brazil.
If I command:
library(maps)
library(mapdata)
map("worldHires", c("Argentina", "Brazil"))
It works fine. However, if I want to _colour_ the interior:
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",
2008 Mar 29
3
Generating maps in R
Greetings!
I am trying plot some data on a map in R. Here's the scenario.
I have a variable called probworkinghealthy which contains a predicted
probability of employment for every individual in my sample (about
100,000 observations).
I have another variable, called a001ter, which contains the subject of
residency in the Russian Federation (akin to a US state) for every
individual in the
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
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 Jun 01
3
[spatstat] Convert shapefile to pixel image
Dear all,
I am currently working with the spatstat package, using windows and pixel images.
First:
My aim is to transform a shapefile (see attached) into a pixel image.
My idea is to start transforming the shapefile into a Spatial Polygon file:
x <- readShapeSpatial("200001441.shp")
y <- as(x, "SpatialPolygons")
z <- as.owin(y)
Given z, I want to identify each
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(
2014 Jun 15
0
Problem with converting a list of grids to a list of polygons
Hi.
For a spatial analysis (its visualization) I need to produce a map of
conditions and traits.
When I used SpatialPixelsDataFrame (sp package) my grid cells were regular
and between each row was a small gap, which is not only messy but incorrect.
So I generated the coords of each grid from the centroids in order to
elongate the cells manually (or does anybody know another way to solve
this?).
2017 Jun 01
0
[spatstat] Convert shapefile to pixel image
On 02/06/17 01:17, Lluis.Hurtado at uv.es wrote:
> Dear all,
>
> I am currently working with the spatstat package, using windows and pixel images.
>
> First:
>
> My aim is to transform a shapefile (see attached) into a pixel image.
>
> My idea is to start transforming the shapefile into a Spatial Polygon file:
>
> x <-
2009 Apr 01
3
How to prevent inclusion of intercept in lme with interaction
Dear friends of lme,
After so many year with lme, I feel ashamed that I cannot get this to work.
Maybe it's a syntax problem, but possibly a lack of understanding.
We have growth curves of new dental bone that can well be modeled by a
linear growth curve, for two different treatments and several subjects as
random parameter. By definition, newbone is zero at t=0, so I tried to force
the