[R-sig-Geo] kml generation question

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Jul 13 18:04:40 CEST 2009


On Mon, Jul 13, 2009 at 4:32 PM, Matt Oliver<moliver at udel.edu> wrote:
> I tried to polygon.....you are right...too  slow
>
> I'm not sure how to resample to get a regular grid...using interp or interpp
> would not be wise because of the size of the grid...

 A quick bodge would be to ignore the slight change in lat long
spacing and create some new lat-long coords that are regularly spaced:

 > lonr=seq(min(lon),max(lon),len=length(lon))
 > latr=seq(min(lat),max(lat),len=length(lat))

 can you tell the difference between:

 > image(lonr,latr,mcsst)

and:

 > image(lon,lat,mcsst)

?

I'm sure the difference in longitude isn't worth worrying about:

 > range(diff(lon))
 [1] 0.01184845 0.01185608

 but the lat difference is possibly significant:

 > range(diff(lat))
 [1] 0.008270264 0.009750366

I'll see if I can dig up my resampling code - basically it created new
coordinates for lat and lon (as above) and then mapped those into
indexes in the array.

Barry



More information about the R-sig-Geo mailing list