[R-sig-Geo] Problem in converting SpatialPolygonsDataFrame to owin object
Roger Bivand
Roger.Bivand at nhh.no
Thu Sep 14 12:19:18 CEST 2006
On Thu, 14 Sep 2006, Edzer J. Pebesma wrote:
> Debarchana Ghosh wrote:
> >
> >
> >
>
> > works fine; I modified the code such that
> > xx1<-as(xx, "owin")
> >
> > will work fine as well in the future.
> > --
> >
> >
> >
> > So I just download and install the updated spspatstat package?
> I said "future", not "near future" or "now"; spspatstat isn't on CRAN.
> If you wish you could download the source from anonymous cvs on the
> r-spatial sourceforge project. It is not there where your problem is,
> however, as you were able to transform to SpatialPolygons anyway.
> > Also, I know attachment is not the right way to converse on this
> > list-serve but I couldn't think of any other way to show my study
> > area. So I've attached the image of my study area (polygon). As i've
> > mentioned in my earlier email, I've read a shapefile in R and created
> > a object (xx) of class SpatialPolygonDataFrame. Howver when I try to
> > convert xx to owin I get the following error. As shown in the
> > attachment, the lines do not intersect but has 7 contigous US counties.
> >
> > Any solution to this problem will be very helpful.
> The problem may be that polygons are only slightly intersecting (which
> you cannot find out from a bitmap image), or that some code is making
> wrong assumptions. The error message comes from the owin function in the
> spatstat package. If the author of the package doesn't listen to this
> list, you could contact him directly (I Cc:d this message). To me, at
> first glance it looked like the error generating code is a fairly recent
> add to spatstat, but I may be wrong on that.
Is it possible to make the offending shapefiles available to me/others?
Without them it is very difficult to debug - SpatialPolygons do not check
for intersections. I would suggest using spgpc (also on sourceforge) to
clean the polygons, but first we need to find out if they do intersect.
Roger
> --
> Edzer
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no
More information about the R-sig-Geo
mailing list