6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

RでGIS(投影法の定義と投影変換)

Last updated at Posted at 2024-10-26

shapefileの読み込み

# Shapefileの読み込み
library(sf)
shapefile_data <- read_sf("hoge/hoge.shp")

投影法の定義

今回のデータはEPSG:6668 JGD2011なのでそれを定義するには、st_crsを使ってEPSGコードを指定する。

st_crs(shp) <- 6668

shapefileの情報を見ると投影法(Geodatic CRS)がJGD2011となっていることがわかる。
image.png

プロットしてみる

ggplot(data = shp) +
  geom_sf()

image.png

投影変換

投影法を変換するにはst_transformで変換した投影法のEPSGコードをしてする。
以下ではEPSG:6679 JGD2011平面直角座標系 第11系に変換する。

shp_projection <- st_transform(shp,crs=6679)

情報を見るとは無事EPSG:6679 JGD2011平面直角座標系 第11系になっていることがわかる
image.png

プロットしてみる

ggplot(data = shp_projection) +
  geom_sf()

image.png

無事投影変換できました。

6
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?