Skip to content

transform spatial points into data.frame

3 messages · Johannes Radinger, Edzer Pebesma, Kenneth Takagi

#
Hello,

probably this is a very simple task:

How can I transform spatial points (assigned coordinates with rgdal)  
into a ordinary data.frame
where the first column is name of the point and the second and third  
columns are
X and Y?

/johannes
#
did you try

as.data.frame(x)

?
On 02/01/2012 11:33 AM, Johannes Radinger wrote:

  
    
#
Johannes Radinger <JRadinger <at> gmx.at> writes:
coordinates with rgdal)
second and third
Hi Johannes,

if it is a S3 or S4 object, you can try using the @ symbol:
sp.df = myspatialpts at data

where myspatialpts is the object containing your spatial 
points.

HTH,
Ken