给定一个工作生成文件,它将世界地图裁剪到特定国家的边界框。
# boxing:
INDIA_crop.tif: ETOPO1_Ice_g_geotiff.tif
gdal_translate -projwin 67.0 37.5 99.0 05.0 ETOPO1_Ice_g_geotiff.tif INDIA_crop.tif
# ulx uly lrx lry // W N E S
# unzip:
ETOPO1_Ice_g_geotiff.tif: ETOPO1.zip
unzip ETOPO1.zip
touch ETOPO1_Ice_g_geotiff.tif
# download:
ETOPO1.zip:
curl -o ETOPO1.zip 'http://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/data/ice_surface/grid_registered/georeferenced_tiff/ETOPO1_Ice_g_geotiff.zip'
clean:
rm `ls | grep -v 'zip' | grep -v 'Makefile'`
鉴于我目前每次都必须通过手动编辑生成文件来更改此生成文件以进行更改:
1. the country name,
2. its North border geocoordinate,
3. its South border geocoordinate,
4. its East border geocoordinate,
5. its West border geocoordinate.
鉴于我也有所有国家的数据集,例如:
data = [
{ "W":-62.70; "S":-27.55;"E": -54.31; "N":-19.35; "item":"Paraguay" },
{ "W": 50.71; "S": 24.55;"E": 51.58; "N": 26.11; "item":"Qatar" },
{ "W": 20.22; "S": 43.69;"E": 29.61; "N": 48.22; "item":"Romania" },
{ "W": 19.64; "S": 41.15;"E":-169.92; "N": 81.25; "item":"Russia" },
{ "W": 29.00; "S": -2.93;"E": 30.80; "N": -1.14; "item":"Rwanda" },
{ "W": 34.62; "S": 16.33;"E": 55.64; "N": 32.15; "item":"Saudi Arabia"}
];
如何循环每行数据以便将参数设置到我的 makefile 中?所以我一次输出所有COUNTRYNAME_crop.tif
带有正确边界框的文件。