@@ -61,7 +61,7 @@ seine_simp = st_simplify(seine, dTolerance = 2000) # 2000 m
6161``` {r seine-simp, echo=FALSE, fig.cap="seine のオリジナルと簡略化した形状の比較。", warning=FALSE, fig.scap="Simplification in action.", message=FALSE, fig.asp=0.5, dev="ragg_png"}
6262library(tmap)
6363p_simp1 = tm_shape(seine) + tm_lines() +
64- tm_title("オリジナルデータ") + tm_layout(fontfamily = "HiraginoSans-W3 ")
64+ tm_title("オリジナルデータ") + tm_layout(fontfamily = "Noto Sans CJK JP ")
6565p_simp2 = tm_shape(seine_simp) + tm_lines() +
6666 tm_title("st_simplify")
6767tmap_arrange(p_simp1, p_simp2, ncol = 2)
@@ -102,7 +102,7 @@ us_states_simp2 = rmapshaper::ms_simplify(us_states, keep = 0.01,
102102\index{べくた@ベクタ!かんりゃくか@簡略化}
103103簡略化の代わりに、ポリゴンや線のジオメトリの境界を平滑化するという方法もあり、** smoothr** パッケージ\index{smoothr (package)}で実装されている。
104104平滑化はジオメトリのエッジを補間するため、必ずしも頂点の数が少なくなるわけではないが、ラスタを空間的にベクトル化したジオメトリを扱うときに特に有用である (このトピックは Chapter \@ ref(raster-vector) で説明する)。
105- ** Smoothr** は、Gaussian kernel 回帰、Chaikin's corner cutting アルゴリズム、スプライン補間の 3 つの平滑化手法を実装しており、パッケージ vignette と[ web] ( https://strimas.com/smoothr/ ) で説明されている 。
105+ ** Smoothr** は、Gaussian kernel 回帰、Chaikin's corner cutting アルゴリズム、スプライン補間の 3 つの平滑化手法を実装しており、パッケージ vignette と[ web] ( https://strimas.com/smoothr/ ) で説明している 。
106106` st_simplify() ` と同様に、平滑化アルゴリズムは「トポロジー」を保存しないことに注意。
107107** smoothr** の主要関数は ` smooth() ` であり、 ` method ` 引数は使用する平滑化手法を指定する。
108108以下は、Gaussian kernel 回帰を使用して、` method=ksmooth ` を使用して米国の州の境界線を滑らかにする。
@@ -117,7 +117,7 @@ Figure \@ref(fig:us-simp) で、Douglas-Peucker (`st_simplify`)、Visvalingam (`
117117
118118``` {r us-simp, echo=FALSE, fig.cap="ポリゴンの簡略化。sf (右上)、rmapshaper (左下)、smoothr (右下) の各パッケージの関数で生成された簡略版と元のアメリカ合衆国のジオメトリ形状を比較。", warning=FALSE, fig.scap="Polygon simplification in action.", dev="ragg_png"}
119119library(tmap)
120- p_ussimp1 = tm_shape(us_states) + tm_polygons() + tm_title("オリジナルデータ") + tm_layout(fontfamily = "HiraginoSans-W3 ")
120+ p_ussimp1 = tm_shape(us_states) + tm_polygons() + tm_title("オリジナルデータ") + tm_layout(fontfamily = "Noto Sans CJK JP ")
121121p_ussimp2 = tm_shape(us_states_simp1) + tm_polygons() + tm_title("st_simplify")
122122p_ussimp3 = tm_shape(us_states_simp2) + tm_polygons() + tm_title("ms_simplify")
123123p_ussimp4 = tm_shape(us_states_simp3) + tm_polygons() + tm_title('smooth(method = "ksmooth")')
@@ -192,11 +192,11 @@ seine_buff_50km = st_buffer(seine, dist = 50000)
192192p_buffs1 = tm_shape(seine_buff_5km) + tm_polygons(fill = "name") +
193193 tm_shape(seine) + tm_lines() +
194194 tm_title("5 km バッファ") +
195- tm_layout(legend.show = FALSE, fontfamily = "HiraginoSans-W3 ")
195+ tm_layout(legend.show = FALSE, fontfamily = "Noto Sans CJK JP ")
196196p_buffs2 = tm_shape(seine_buff_50km) + tm_polygons(fill = "name") +
197197 tm_shape(seine) + tm_lines() +
198198 tm_title("50 km バッファ") +
199- tm_layout(legend.show = FALSE, fontfamily = "HiraginoSans-W3 ")
199+ tm_layout(legend.show = FALSE, fontfamily = "Noto Sans CJK JP ")
200200tmap_arrange(p_buffs1, p_buffs2, ncol = 2)
201201```
202202
@@ -314,13 +314,13 @@ st_crs(nz_scale) = st_crs(nz_sfc)
314314st_crs(nz_rotate) = st_crs(nz_sfc)
315315p_at1 = tm_shape(nz_sfc) + tm_polygons() +
316316 tm_shape(nz_shift) + tm_polygons(col = "red") +
317- tm_title("シフト") + tm_layout(fontfamily = "HiraginoSans-W3 ")
317+ tm_title("シフト") + tm_layout(fontfamily = "Noto Sans CJK JP ")
318318p_at2 = tm_shape(nz_sfc) + tm_polygons() +
319319 tm_shape(nz_scale) + tm_polygons(col = "red") +
320- tm_title("拡大縮小") + tm_layout(fontfamily = "HiraginoSans-W3 ")
320+ tm_title("拡大縮小") + tm_layout(fontfamily = "Noto Sans CJK JP ")
321321p_at3 = tm_shape(nz_sfc) + tm_polygons() +
322322 tm_shape(nz_rotate) + tm_polygons(col = "red") +
323- tm_title("回転") + tm_layout(fontfamily = "HiraginoSans-W3 ")
323+ tm_title("回転") + tm_layout(fontfamily = "Noto Sans CJK JP ")
324324tmap_arrange(p_at1, p_at2, p_at3, ncol = 3)
325325```
326326
@@ -636,11 +636,11 @@ linestring_sf2
636636
637637``` {r line-cast, echo=FALSE, fig.cap="複合線 (左) と線 (右) 間の型キャストの例。", warning=FALSE, fig.scap="Examples of type casting.", message=FALSE, dev="ragg_png"}
638638p_lc1 = tm_shape(multilinestring_sf) + tm_lines(lwd = 3) +
639- tm_title("複合線") + tm_layout(fontfamily = "HiraginoSans-W3 ")
639+ tm_title("複合線") + tm_layout(fontfamily = "Noto Sans CJK JP ")
640640linestring_sf2$name = c("Riddle Rd", "Marshall Ave", "Foulke St")
641641p_lc2 = tm_shape(linestring_sf2) + tm_lines(lwd = 3, col = "name", palette = "Set2") +
642642 tm_title("線") +
643- tm_layout(legend.show = FALSE, fontfamily = "HiraginoSans-W3 ")
643+ tm_layout(legend.show = FALSE, fontfamily = "Noto Sans CJK JP ")
644644tmap_arrange(p_lc1, p_lc2, ncol = 2)
645645```
646646
@@ -783,11 +783,11 @@ dem_agg = aggregate(dem, fact = 5, fun = mean)
783783p_ar1 = tm_shape(dem) +
784784 tm_raster(col.scale = tm_scale_continuous()) +
785785 tm_title("A. オリジナル") +
786- tm_layout(frame = FALSE, legend.show = FALSE, fontfamily = "HiraginoSans-W3 ")
786+ tm_layout(frame = FALSE, legend.show = FALSE, fontfamily = "Noto Sans CJK JP ")
787787p_ar2 = tm_shape(dem_agg) +
788788 tm_raster(col.scale = tm_scale_continuous()) +
789789 tm_title("B. Aggregate 後") +
790- tm_layout(frame = FALSE, legend.show = FALSE, fontfamily = "HiraginoSans-W3 ")
790+ tm_layout(frame = FALSE, legend.show = FALSE, fontfamily = "Noto Sans CJK JP ")
791791tmap_arrange(p_ar1, p_ar2, ncol = 2)
792792```
793793
@@ -804,7 +804,7 @@ agg_df = data.frame(
804804 Dimensions = c("117 * 117", "24 * 24"),
805805 Extent = c("794599.1, 798208.6, 8931775, 8935384", "794599.1, 798301.1, 8931682, 8935384")
806806)
807- knitr::kable(agg_df, caption = "Properties of the original and aggregated raster. ", booktabs = TRUE)
807+ knitr::kable(agg_df, caption = "オリジナルと集計後のラスタの ", booktabs = TRUE)
808808```
809809
810810\index{らすた@ラスタ!ぶんかい@分解}
@@ -852,19 +852,19 @@ dem_resampl1 = resample(dem, target_rast, method = "near")
852852
853853tm1 = tm_shape(dem) +
854854 tm_raster(col.scale = tm_scale(breaks = seq(200, 1100, by = 150))) +
855- tm_title("Original raster ") +
855+ tm_title("オリジナル ") +
856856 tm_layout(frame = FALSE, legend.show = FALSE)
857857tm2 = tm_shape(dem) +
858858 tm_raster(col.scale = tm_scale(breaks = seq(200, 1100, by = 150))) +
859- tm_title("Target raster ") +
859+ tm_title("対象 ") +
860860 tm_layout(frame = FALSE, legend.show = FALSE) +
861861 tm_shape(target_rast_p, is.main = TRUE) +
862862 tm_borders()
863863tm3 = tm_shape(dem) +
864864 tm_raster(col_alpha = 0) +
865865 tm_shape(dem_resampl1) +
866866 tm_raster(col.scale = tm_scale(breaks = seq(200, 1100, by = 150))) +
867- tm_title("Resampled raster ") +
867+ tm_title("リサンプリング ") +
868868 tm_layout(frame = FALSE, legend.show = FALSE)
869869tmap_arrange(tm1, tm2, tm3, nrow = 1)
870870```
@@ -916,23 +916,23 @@ library(tmap)
916916tm1 = tm_shape(dem) +
917917 tm_raster(col.scale = tm_scale(breaks = seq(200, 1100, by = 150))) +
918918 tm_title("オリジナル") +
919- tm_layout(frame = FALSE, legend.show = FALSE, fontfamily = "HiraginoSans-W3 ")
919+ tm_layout(frame = FALSE, legend.show = FALSE, fontfamily = "Noto Sans CJK JP ")
920920tm2 = tm_shape(dem_resampl1) +
921921 tm_raster(col.scale = tm_scale(breaks = seq(200, 1100, by = 150))) +
922922 tm_title("最近傍 (near)") +
923- tm_layout(frame = FALSE, legend.show = FALSE, fontfamily = "HiraginoSans-W3 ")
923+ tm_layout(frame = FALSE, legend.show = FALSE, fontfamily = "Noto Sans CJK JP ")
924924tm3 = tm_shape(dem_resampl2) +
925925 tm_raster(col.scale = tm_scale(breaks = seq(200, 1100, by = 150))) +
926926 tm_title("双一次補間 (bilinear)") +
927- tm_layout(frame = FALSE, legend.show = FALSE, fontfamily = "HiraginoSans-W3 ")
927+ tm_layout(frame = FALSE, legend.show = FALSE, fontfamily = "Noto Sans CJK JP ")
928928tm4 = tm_shape(dem_resampl3) +
929929 tm_raster(col.scale = tm_scale(breaks = seq(200, 1100, by = 150))) +
930930 tm_title("三次補間 (cubic)") +
931- tm_layout(frame = FALSE, legend.show = FALSE, fontfamily = "HiraginoSans-W3 ")
931+ tm_layout(frame = FALSE, legend.show = FALSE, fontfamily = "Noto Sans CJK JP ")
932932tm5 = tm_shape(dem_resampl4) +
933933 tm_raster(col.scale = tm_scale(breaks = seq(200, 1100, by = 150))) +
934934 tm_title("三次スプライン補間 (cubicspline)") +
935- tm_layout(frame = FALSE, legend.show = FALSE, fontfamily = "HiraginoSans-W3 ")
935+ tm_layout(frame = FALSE, legend.show = FALSE, fontfamily = "Noto Sans CJK JP ")
936936tm6 = tm_shape(dem_resampl5) +
937937 tm_raster(col.scale = tm_scale(breaks = seq(200, 1100, by = 150))) +
938938 tm_title("lanczos") +
0 commit comments