projecting shapefile using ggplot2

29 views
Skip to first unread message

Jean-Paul Huys

unread,
Apr 29, 2016, 12:12:53 PM4/29/16
to ggp...@googlegroups.com

Hi All,

I am using ggplot2 to map shape files – I have been successful until now.

I ran the NOAA Hysplit model which creates a GIS shapefile.

I use library(rgdal) and library(rgeos) to read the shp using the folowing code:

 

HA <- readOGR("q:/20130430", "GIS_traj01_199021")

HA <- spTransform(HA, CRS("+proj=longlat +datum=WGS84"))

HA@data$id = rownames(HA@data)

HA.points = fortify(HA, region="id")

HA.df = join(HA.points, HA@data, by="id")

 

 

But I get the following message:

 

Error: ggplot2 doesn't know how to deal with data of class SpatialPointsDataFrame

 

 

Any advice?

Thanks.

Cheers,

 

 

Jean-Paul Huys

 

GIS_traj_199021_01.att
GIS_traj01_199021.dbf
GIS_traj01_199021.prj
GIS_traj01_199021.shp
GIS_traj01_199021.shx
GIS_traj_199021_01.txt
Reply all
Reply to author
Forward
0 new messages