diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-10-29 14:44:19 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-10-29 14:44:19 +0900 |
| commit | 17f6009bfc6589d43e10233040b125675d24c5c8 (patch) | |
| tree | 8f6606e4b5b086e3e61792a6965b27867bed5c18 /src/data/parks-geojson.ts | |
| parent | cf5468ffaef1b43e5cc529af2d072f1f08af9ba4 (diff) | |
parks: 複数ポリゴンとOSMポリゴンの置き換えに対応
同じ公園名の複数ポリゴンをまとめてズーム・アイコン表示する。import-manual-parks.py に --override-name を追加し、手入力ポリゴンでOSMを置き換えられるようにした。草地広場・多目的広場を一覧の検索・ピクニック絞り込みに反映。
Diffstat (limited to 'src/data/parks-geojson.ts')
| -rw-r--r-- | src/data/parks-geojson.ts | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/data/parks-geojson.ts b/src/data/parks-geojson.ts index e12d297..9fd9d4f 100644 --- a/src/data/parks-geojson.ts +++ b/src/data/parks-geojson.ts @@ -20,6 +20,23 @@ function isHiddenUnlisted(props: any): boolean { const osmFeatures = ((osm as any).features ?? []).filter( (f: any) => !isHiddenUnlisted(f.properties), ); -const features = [...osmFeatures, ...((manual as any).features ?? [])]; +const manualFeatures = (manual as any).features ?? []; + +// 手入力ポリゴンでOSM側の形を置き換える公園(例: 道路で分かれた公園)。 +// QGISの属性 override=true、または import-manual-parks.py の --override-name で付く。 +const overrideNames = new Set( + manualFeatures + .filter((f: any) => { + const value = f?.properties?.override; + return value === true || value === 1 || value === "true" || value === "1"; + }) + .map((f: any) => f?.properties?.our_name) + .filter(Boolean), +); + +const features = [ + ...osmFeatures.filter((f: any) => !overrideNames.has(f.properties?.our_name)), + ...manualFeatures, +]; export default { type: "FeatureCollection", features }; |
