投稿

PythonでJAXAの人工衛星だいち(ALOS)の世界標高データ活用(3)

イメージ
前回: https://shikuuk.blogspot.com/2025/07/pythonjaxaalos2.html  第3部は2つ(以上)の5*5タイルを読み込み、そのDataをMargeしてMosicImageにしたあと、 Matplotlib でTry to drawとThinkします。   ALOS は JapanDomain だけでなく GlobalなElavationData をContainしているAs、例えば Indonesia の SumatraIsland をDrawにTryします。  まずはALOSの DownLoadHP でIndonesiaSumatraIslandのAroundのConditionをConfirmします。  SumatraIslandは5*5のTileでViewすると、North-Westは N10-E95 で、そこからS05E105のTileまでがArea we should readのRegionと思われます。  一度にそこまで進めると、Errorが出た時が面倒くさいので、まずはN10-E95と N5-E100 の2つのTileを処理するところからはじめてみました。従来のCodeを使って当該2TilesをDownLaodし、MatplotlibでDrawすると、以下のOutputになります。ColarのContourFigureとLineのContour Figureを作成していますが、最初、ColorのContourFigureでは海岸線が見づらくて、LineContourを追加したところ、LineContourもColorContourによく似た表示になりました。「なぜかなぁ?」とちょっと悩みましたが、ContourLineの間隔、言い換えれば等高線の間隔が小さすぎるということが原因でした。下のLineContourは標高値200m間隔になっています。これでもまだごちゃごちゃしていて見づらい感じは残っています。  例えばContourの間隔を500mにすると、このようなFigureにbecomeしました。  LineContourがかなり見やすくなったと思います。  一応コードも残しておきます。(‘ levels = np.arange ( math.floor ( min_elev / 200 ) * 2...

PythonでJAXAの人工衛星だいち(ALOS)の世界標高データ活用(2)

イメージ
前回: https://shikuuk.blogspot.com/2025/07/jaxaalospython.html  第2部はさきほどDownloadした「N030E130_N035E135.zip」に含まれている5×5のTileを1枚の大きなModelに結合する処理(モザイク処理と呼ぶそうです)のCodeをGemini先生にお願いしました。  ※JAXAさま AW3D30 DSM data map Download Page参照 ( https://www.eorc.jaxa.jp/ALOS/en/aw3d30/data/index.htm ) import rasterio import numpy as np import os from rasterio.enums import Resampling from rasterio.merge import merge # Ensure merge is imported def merge_elevation_tiles ( tile_dir , output_filepath ) :     """     Reads all GeoTIFF elevation tiles in the specified directory,     merges them into a single GeoTIFF file, and saves it.     Args:         tile_dir (str): Path to the directory containing GeoTIFF files.         output_filepath (str): Output path for the merged GeoTIFF file.     Returns:         str: Path to the merged GeoTIFF file (on success), or None (on failure).     "...