This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -ex | |
| # 引数のチェック | |
| if [ $# -ne 2 ]; then | |
| echo "エラー: 必要な引数が指定されていません。" >&2 | |
| echo "使用方法: $0 <カラーテーブルファイル: 例 color_table.txt> <対象フィールド名: 例 Max_Rank>" >&2 | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -ex | |
| # 出力ファイル名 | |
| OUTPUT_FILE="merged.geojson" | |
| # カレントディレクトリの .geojson ファイルを取得 | |
| geojson_files=() | |
| for file in *.geojson; do | |
| if [ -f "$file" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -ex | |
| # サフィックスが指定されているか確認 | |
| if [ $# -ne 1 ]; then | |
| echo "Usage: $0 <suffix>" | |
| exit 1 | |
| fi | |
| suffix=$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # GitHub APIトークン | |
| GITHUB_TOKEN="GITHUB_TOKEN" | |
| REPO_OWNER="yaizu-city" | |
| REPO_NAME="opendata" | |
| BRANCH_NAME="add-data-test" # アップロード先のブランチ名 | |
| TARGET_DIR="data/テスト" # リポジトリ内のターゲットディレクトリ | |
| # base64ファイルをループ処理 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -ex | |
| # 処理対象の拡張子リスト | |
| extensions=("shp" "prj" "cpg" "dbf" "sbn" "fbn" "ain" "ixs" "mxs" "atx" "shp.xml" "shx" "mxd" "sbx" "geojson" "yml") | |
| # カレントディレクトリ内のファイルをループ処理 | |
| for ext in "${extensions[@]}"; do | |
| for file in *."$ext"; do | |
| # ファイルが存在する場合のみ処理 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -ex | |
| find . -type f -name '*EPSG6676.*' | while read filepath; do | |
| dirname=$(dirname "$filepath") | |
| filename=$(basename "$filepath") | |
| newname=$(echo "$filename" | sed 's/EPSG6676//') | |
| mv "$filepath" "$dirname/$newname" | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -ex | |
| # カレントディレクトリ以下のすべての .shp または .SHP ファイルを探索 | |
| find . -type f -iname "*.shp" | while read -r shp_file; do | |
| # ファイル名から拡張子を取り除いたベース名を取得(大文字小文字を区別しない) | |
| base_name="${shp_file%.*}" | |
| # cpg ファイルのパスを作成 | |
| cpg_file="${base_name}.cpg" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # UTF-8 NFCを適用するためにiconvを利用 | |
| normalize_to_nfc() { | |
| echo "$1" | iconv -f UTF-8 -t UTF-8-MAC | iconv -f UTF-8-MAC -t UTF-8 | |
| } | |
| # 現在のディレクトリにあるすべてのファイルを対象に処理 | |
| for file in *; do | |
| # ファイルかどうかを確認 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # 引数でGeoJSONファイルのパスを受け取る | |
| input_file="$1" | |
| output_file="cleaned_geojson.json" | |
| # jqを使ってSplitKEYキーを削除 | |
| jq '(.features[] | .properties) |= with_entries(select(.key != "SplitKEY"))' "$input_file" > "$output_file" | |
| echo "SplitKEYのキーと値が削除されたGeoJSONファイルを作成しました: $output_file" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -ex | |
| # 引数チェック | |
| if [ -z "$1" ]; then | |
| echo "使用方法: $0 <頭文字>" | |
| exit 1 | |
| fi | |
| # 引数から頭文字を取得 |