[R-sig-Geo] kriging -- grass -- asciigrid

Roger Bivand Roger.Bivand at nhh.no
Sun Mar 2 21:51:23 CET 2008


On Fri, 29 Feb 2008, Jose Funes wrote:

> Dear members,
>
> I have tried to export a kriging map to arcgis as asciigrid or image.
> I have used the functions write.asciigrid and writeRast6sp(grass), in
> both cases any success; In the former when exporting it, I got the
> following message " Asciigrid does not support grids with non-square
> cells".

Please quote your exact code. The function writeAsciiGrid() in maptools 
will probably work, while write.asciigrid() in sp (which we ought to 
deprecate, pointing to maptools) does not. The problem is machine fuzz, 
the 90.0 values probably differ by 1e-16 or some other small amount - 
writeAsciiGrid() tests and corrects for the fuzz.

> I checked for the krige map topology characteristics using the
> following code:
> getGridTopology(lidekri)
>
> Apparently cell size looks fine: see below
>
>                         s1       s2
> cellcentre.offset -363565.9 175563.0
> cellsize               90.0     90.0
> cells.dim             804.0   1236.0
>
> For the writeRast6sp function from "spgrass6" library
>
> writeRast6sp(lidekri,"lidekri",zcol="var1.pred",NODATA=-9999),
>

Was your goal to write an Arc ASCII grid as a file, or to write the data 
to GRASS?

Did you try writeRAST6() in spgrass6, which uses other file formats?

Did you try the Arc ASCII grid driver "AAIGrid" with writeGDAL() in rgdal?

Hope this helps,

Roger

> I got the following message error
>
> "Error in system(paste(paste("g.tempfile", .addexe(), sep = ""),
> "pid=",  :  g.tempfilepid=421 not found"
>
> I will greatly appreciate any suggestions to get around this technical problem.
>
> Sincerely,
>
> Jose Funes
>
>
>
>
>
>
>
>
>
> On Fri, Feb 29, 2008 at 6:00 AM,  <r-sig-geo-request at stat.math.ethz.ch> wrote:
>> Send R-sig-Geo mailing list submissions to
>>         r-sig-geo at stat.math.ethz.ch
>>
>>  To subscribe or unsubscribe via the World Wide Web, visit
>>         https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>  or, via email, send a message with subject or body 'help' to
>>         r-sig-geo-request at stat.math.ethz.ch
>>
>>  You can reach the person managing the list at
>>         r-sig-geo-owner at stat.math.ethz.ch
>>
>>  When replying, please edit your Subject line so it is more specific
>>  than "Re: Contents of R-sig-Geo digest..."
>>
>>
>>  Today's Topics:
>>
>>    1. estimates for paths of travel given two time series,      drawn
>>       from two corresponding spatial densities (Galkowski, Jan)
>>    2. makeGrid(PBSmapping) (Markus Loecher)
>>    3. Choice of Spatial weights (stefan lhachimi)
>>
>>
>>  ----------------------------------------------------------------------
>>
>>  Message: 1
>>  Date: Thu, 28 Feb 2008 13:58:49 -0500
>>  From: "Galkowski, Jan" <jgalkows at akamai.com>
>>  Subject: [R-sig-Geo] estimates for paths of travel given two time
>>         series, drawn from two corresponding spatial densities
>>  To: <r-sig-geo at stat.math.ethz.ch>
>>  Message-ID:
>>         <76EB4827B2104D40AE7E43AA5D8582EA011A9D32 at MAVS1.kendall.corp.akamai.com>
>>
>>  Content-Type: text/plain
>>
>>  This is less an R question and more a request to the community for
>>  literature references and the like.
>>
>>  I'm interested in the following inferential question.  What's the max
>>  likelihood estimate for a path of travel of a point across a plane
>>  having stable, smooth densities of two separate variables given two time
>>  series of their values at the point as it moves?   Suppose all that's
>>  available is the ratio of the variables?
>>
>>  This is motivated by problems of inferring movement of biological
>>  specimens between nesting and migratory regions, or the problem of
>>  recovery of travel given the technique described here:
>>
>>     http://www.pnas.org/cgi/content/abstract/105/8/2788
>>
>>  Despite that, are there R packages which might help this?  I ask because
>>  I often find real gems buried within many R packages, gems which aren't
>>  obviously related to their primary subject.
>>
>>  Thanks much.
>>
>>         [[alternative HTML version deleted]]
>>
>>
>>
>>  ------------------------------
>>
>>  Message: 2
>>  Date: Thu, 28 Feb 2008 15:00:28 -0500
>>  From: Markus Loecher <loecher at eden.rutgers.edu>
>>  Subject: [R-sig-Geo] makeGrid(PBSmapping)
>>  To: r-sig-geo at stat.math.ethz.ch
>>  Message-ID: <20080228195805.F18A632408E at annwn13.rutgers.edu>
>>  Content-Type: text/plain; charset="us-ascii"; format=flowed
>>
>>  Dear geo experts,
>>  I am clearly misunderstanding the role of the projection argument in
>>  the wonderful utility makeGrid(PBSmapping).
>>  I had hoped that by setting projection ="LL" the resulting grid would
>>  be equidistant in "real" space, and hence curvilinear in lat/lon space.
>>  But the following code yields the identical, regular grid,
>>  irrespective of the projection argument:
>>
>>         mypolys <- makeGrid(x= seq(-123,-122,length=10), y = seq(33, 34,
>>  length=10), byrow = FALSE, addSID = TRUE, projection = "LL")
>>         plotMap(mypolys)
>>         mypolys <- makeGrid(x= seq(-123,-122,length=10), y = seq(33, 34,
>>  length=10), byrow = FALSE, addSID = TRUE, projection = 1)
>>         plotMap(mypolys)
>>
>>  Is there an easy way to create a rectangular grid in lat/lon space ?
>>  Should I first translate the points to UTM coordinates ?
>>
>>  Thanks!
>>
>>  Markus
>>
>>
>>
>>  ------------------------------
>>
>>  Message: 3
>>  Date: Fri, 29 Feb 2008 11:36:18 +0100
>>  From: "stefan lhachimi" <stefan.duke at gmail.com>
>>  Subject: [R-sig-Geo] Choice of Spatial weights
>>  To: r-sig-geo at stat.math.ethz.ch
>>  Message-ID:
>>         <a211af3b0802290236m53a12cd1h806a3106f508fb54 at mail.gmail.com>
>>  Content-Type: text/plain; charset=ISO-8859-1
>>
>>  Dear all,
>>
>>  as a matter of curiosity does anybody know literature which discusses
>>  what spatial weight to choose (e.g. k-nn, single or double
>>  contiguity)? Or has anybod a good rule of thumb?
>>  I found an article which proposes to try several specification and
>>  take either the one with the highest lambda  or the one with the best
>>  overall model fit (in a regression). But I think that is statistically
>>  speaking that is not very satisfactory, in particular if the
>>  application does not give any indication what weight to use.
>>
>>  Any hints?
>>  Best,
>>  Stefan
>>
>>
>>
>>  ------------------------------
>>
>>  _______________________________________________
>>  R-sig-Geo mailing list
>>  R-sig-Geo at stat.math.ethz.ch
>>  https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>>
>>  End of R-sig-Geo Digest, Vol 54, Issue 27
>>  *****************************************
>>
>
> _______________________________________________
> 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