Skip to content

Projected data in R-Gstat

3 messages · David Marguerit, Edzer Pebesma, Paul Hiemstra

3 days later
#
On 05/11/2012 12:35 PM, David Marguerit wrote:
Yes, it is not correct. You didn't set it, so

proj4string(co)

will give you NA (missing). This means that gstat will assume they are
metric (in m, or km), and compute distances using regular (Euclidian)
distances -- which is wrong!

You have to do the following:

proj4string(co) =  "+proj=longlat +datum=WGS84"

(assuming this is the correct datum setting!)

and then rerun the variogram fitting. In this case, gstat will use great
circle distances instead of Euclidian distances.

An alternative would be to reproject your data, e.g. to the appropriate
UTM zone, and then re-run the variogram estimation and fitting.

http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system

might point you to the appropriate zone.

With best regards,

  
    
#
On 05/14/2012 09:51 PM, Edzer Pebesma wrote:
...in addition, for reprojection of data you can use the spTransform
function from the rgdal package.

regards,
Paul