The answer I have found is both clear and straightforward:
require(maptools)
IloveR<-as(as(readShapeLines(fn="mylinedata.shp"), "SpatialLines"), "psp")
I was hoping someone might be able to point me in the direction of something
like this but I was fortunate enough to stumble across it in one of
Hi there,
I have a spatial road network for which I would like to construct a
"distance map" as in the distmap() function in the spatstat package.
However this function only seems to readily accept .ppp, .psp, and owin
objects. How can I import my data into a format that can be used to create
a d
The distmap calculation works fine for polygons
imported from shapefiles, thanks Adrian and Roger!
Agus
Roger Bivand escribió:
>
> Doing all the conversions as specified, it does work:
>
> library(maptools)
> library(spatstat)
> load("refG.rda")
#Note, refG comes from:
#refG <-
#readOGR("C:/A
Dear list,
I have 2 raster (im) objects (ai and escenai) which
are identical except by 1 single pixel
at position 356,777:
> ai$v[356,777]
[1] 255
> escenai$v[356,777]
[1] NA
I calculate distmap for both:
refdist <- distmap(as.owin(ai))
adist630 <- distmap(as.owin(escenai))
As the only diffe
Finally, I've given up
using distmap on an object imported
from a shp file. Could not solve the casting
problem from the sp object to the owin object.
I've rasterized the vector prior to importing to R
and this is the way I calculate the distmap and export it.
refG25 <- readGDAL("GFOEOABUFActi25.
On Tue, 26 Jun 2007, Agustin Lobo wrote:
Still some problems:
sessionInfo()
R version 2.5.0 (2007-04-23)
i386-pc-mingw32
locale:
LC_COLLATE=Spanish_Spain.1252;LC_CTYPE=Spanish_Spain.1252;LC_MONETARY=Spanish_Spain.1252;LC_NUMERIC=C;LC_TIME=Spanish_Spain.1252
attached base packages:
[1] "sta
Still some problems:
> sessionInfo()
R version 2.5.0 (2007-04-23)
i386-pc-mingw32
locale:
LC_COLLATE=Spanish_Spain.1252;LC_CTYPE=Spanish_Spain.1252;LC_MONETARY=Spanish_Spain.1252;LC_NUMERIC=C;LC_TIME=Spanish_Spain.1252
attached base packages:
[1] "stats" "graphics" "grDevices" "utils"
On Mon, 25 Jun 2007, Edzer J. Pebesma wrote:
> Roger Bivand wrote:
>> On Mon, 25 Jun 2007, Agustin Lobo wrote:
>>
>> > I've tried (among other things):
>> > > limit1 <- read.shape("limit_PNSN2000.shp")
>> > Shapefile type: Polygon, (5), # of Shapes: 2
>> > > limit1poly <- Map2poly(limit1)
Roger Bivand wrote:
> On Mon, 25 Jun 2007, Agustin Lobo wrote:
>
>> I've tried (among other things):
>>> limit1 <- read.shape("limit_PNSN2000.shp")
>> Shapefile type: Polygon, (5), # of Shapes: 2
>>> limit1poly <- Map2poly(limit1)
>>> limit1owin <- as(limit1poly,"owin")
>> Error in .classEnv(thi
On Mon, 25 Jun 2007, Agustin Lobo wrote:
I've tried (among other things):
limit1 <- read.shape("limit_PNSN2000.shp")
Shapefile type: Polygon, (5), # of Shapes: 2
limit1poly <- Map2poly(limit1)
limit1owin <- as(limit1poly,"owin")
Error in .classEnv(thisClass) : unable to find an environment
I've tried (among other things):
> limit1 <- read.shape("limit_PNSN2000.shp")
Shapefile type: Polygon, (5), # of Shapes: 2
> limit1poly <- Map2poly(limit1)
> limit1owin <- as(limit1poly,"owin")
Error in .classEnv(thisClass) : unable to find an environment containing
class "polylist"
> limit2
On Fri, 22 Jun 2007, Agustin Lobo wrote:
> Dear sig-geos,
>
> I have to calculate a distmap (that is, a map
> in which the value of each cell is the distance
> from the cell to a given object) for a set of polygons.
> It seems to me that distmap.owin in spatstat would do it
> fine, but distmap.owi
Dear sig-geos,
I have to calculate a distmap (that is, a map
in which the value of each cell is the distance
from the cell to a given object) for a set of polygons.
It seems to me that distmap.owin in spatstat would do it
fine, but distmap.owin does not accept objects
imported from shp vectors via
13 matches
Mail list logo