官术网_书友最值得收藏!

Changing projection system

To change projection, we can use spTransform() from the rgdal package. We can do so using a CRS() argument inside spTransform():

map_bd = spTransform(map_bd, CRS("+proj=longlat +datum=WGS84"))

The preceding code sets the projection system to the longitude and latitude and the GCS to WGS84. If we want to change the projection to any other layer's (shapefile's) projection inside CRS(), we can write proj4string() to get the CRS of a new layer and then set it to that. For example, if we want to set the projection system of a layer a to the projection system of layer b, we can do so simply by writing the following: 

a = spTransform(a, CRS(proj4string(b)))
主站蜘蛛池模板: 泽库县| 长阳| 定西市| 贡嘎县| 武川县| 广平县| 铁岭市| 普洱| 灌阳县| 牡丹江市| 黑山县| 石渠县| 辉县市| 洛川县| 南昌县| 苍南县| 苗栗县| 巧家县| 绥宁县| 永康市| 清原| 江油市| 车险| 庆城县| 临城县| 西华县| 平顶山市| 莱芜市| 五原县| 简阳市| 古蔺县| 五河县| 锡林郭勒盟| 高雄县| 鱼台县| 南木林县| 富源县| 大石桥市| 莱芜市| 车致| 开封县|