diff options
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 dadf963..e12d297 100644 --- a/src/data/parks-geojson.ts +++ b/src/data/parks-geojson.ts @@ -3,6 +3,23 @@ import manual from "./kodaira-parks-manual.json"; // OSMから取得したポリゴンと、QGIS等で手描きしたポリゴンをまとめる。 // 手描き分は kodaira-parks-manual.json に置くことで、npm run osm:update で消えない。 -const features = [...((osm as any).features ?? []), ...((manual as any).features ?? [])]; +// +// 一覧にないグラウンド(校庭・運動場・pitch・recreation_ground)と、 +// 名前のない小規模な地物は地図に出さない。 +// 一覧にない公園・緑地のうち、名前のあるものだけを薄い赤で残す。 +function isHiddenUnlisted(props: any): boolean { + if (!props || props.matched || props.our_name) return false; + const name = String(props.name || "").trim(); + const tag = String(props.leisure || props.landuse || ""); + if (!name) return true; + if (/グラウンド|校庭|運動場/.test(name)) return true; + if (tag === "pitch" || tag === "recreation_ground") return true; + return false; +} + +const osmFeatures = ((osm as any).features ?? []).filter( + (f: any) => !isHiddenUnlisted(f.properties), +); +const features = [...osmFeatures, ...((manual as any).features ?? [])]; export default { type: "FeatureCollection", features }; |
