Coerce your im object into a SpatialGridDataFrame then export it using rgdal

> dvty.sm20<-eval.im(dvty.sm>20)
> dvty.sg<-as(dvty.sm, "SpatialGridDataFrame")
> proj4string(dvty.sg)<-CRS("+init=epsg:2154")
> writeGDAL(dvty.sg, "C:/foo.tif", drivername="GTiff")

Does it work for you?


2011/5/18 Matev¾ Pavliè <[email protected]>

> Hi all,
>
> I can not for the life of me find out how to covert this :
>
> plot(eval.im(mol.simpson.s >0.3 & (mol.den/max(mol.den))>0.3))
>
> into any kind of grid or shape with projection that can be used in some GIS
> software. Any help is greatly appreciated.
>
> m
>
> -----Original Message-----
> From: [email protected] [mailto:
> [email protected]] On Behalf Of Mathieu Rajerison
> Sent: Wednesday, May 18, 2011 8:34 AM
> To: [email protected]
> Subject: Re: [R-sig-Geo] density /diversity of points
>
> Yes, you're totally right about the name of the objects :)
>
> So, setting exclude=FALSE is necessary if one wishes to include the point
> itself in the marktable function and there is no zero values, at least one
> "1"
> clc.tab<-marktable(clc.ppp, R=20, exclude=FALSE)
>
> To get the minimal radius for which a neighbor is found, I simply used
> nndist function
> min(nndist(clc.ppp))
>
> Finally, I decided to set a 2000 units radius and to include the radius
> starting point clc.tab<-marktable(clc.ppp, R=2000, exclude=FALSE)
>
> I get good results
>
> Thanks everybody for everything!
>
> 2011/5/17 Rolf Turner <[email protected]>
>
> > On 18/05/11 05:05, Mathieu Rajerison wrote:
> >
> >> I've tried your method to determine the richness of landscapes on my
> >> area of interest using european corine land cover.
> >>
> >> I converted my polygon layer into a SpatialGridDataFrame then into a
> >> SpatialPointsDataFrame, and finally into a ppp object using one column:
> >> the
> >> type of soil occupation (CLC3_LIB).
> >>
> >> But my problem is that marktable gives me zero values, although I
> >> should get at least a "1" value for one of my columns...
> >>
> >> Here is a sample code:
> >>
> >>> ppp[1:5]$marks
> >>>
> >> [1] Mer et océan
> >> [2] Végétation clairsemée
> >> [3] Pelouses et pâturages naturels
> >> [4] Végétation sclérophylle (y.c. maquis et garrigue) [5] Végétation
> >> sclérophylle (y.c. maquis et garrigue)
> >>
> >>  marktable(ppp[1:10], R=50)
> >>>
> >>      mark
> >> point Aéroports Chantiers Cours et voie d'eau
> >>    1          0         0                   0
> >>    2          0         0                   0
> >>    3          0         0                   0
> >>    4          0         0                   0
> >>    5          0         0                   0
> >>    6          0         0                   0
> >>    7          0         0                   0
> >>    8          0         0                   0
> >>    9          0         0                   0
> >>    10         0         0                   0
> >>      mark
> >> point Equipements sportifs et de loisirs
> >>    1                                   0
> >>    2                                   0
> >>    3                                   0
> >>    4                                   0
> >>    5                                   0
> >>    6                                   0
> >>    7                                   0
> >>    8                                   0
> >>    9                                   0
> >>    10                                  0
> >>
> >> I don't see where the problem is..
> >>
> >> Any help would be greatly appreciated.
> >>
> >
> > Why do you assert that you should get at least one "1"?  If there are
> > no points of your pattern within 50 units of any given point, then the
> > table will indeed consist of nothing but zeros.
> >
> > If you don't believe that this is the problem then please provide a
> > minimal
> > ***reproducible*** example that we can work with, as the posting guide
> > requests.
> >
> > And ***PLEASE*** do not call your point pattern "ppp"; this is the
> > name of a function and class in the spatstat package.  Using it as the
> > name of an object is very confusing and potentially a source of
> > errors.  See fortune("dog").
> >
> >    cheers,
> >
> >        Rolf Turner
> >
>
>         [[alternative HTML version deleted]]
>
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to