在shapefile上绘制点

时间:2017-02-08 17:49:14

标签: r ggplot2

我试图在从shapefile生成的地图上绘制一些点,但无法理解为什么它们没有在地图上正确绘制。

library(rgeos)
library(maptools)
library(plyr)
library(ggplot2)
library(dplyr)
library(sp)
library(rgdal)


# load shapefile 

np_dist <- readShapeSpatial("~/world/coastlines_z1.shp")  #http://data.openstreetmapdata.com/coastlines-generalized-3857.zip
plot(np_dist)  


##### add points

points <- data.frame(lat = c(55.4, 35.8, 36.4), lon = c(-5.5, -5.6, -35.8))
points <- SpatialPoints(points)

plot(points, add= TRUE , col = 'red')

0 个答案:

没有答案