Skip to content

Commit

Permalink
feat: support reservoir flood model (#374)
Browse files Browse the repository at this point in the history
Co-authored-by: lby <[email protected]>
  • Loading branch information
keiya01 and airslice authored Jan 7, 2025
1 parent 1a81da3 commit 9239934
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { createSvgIcon } from "@mui/material";

export const ReservoirFloodingRiskIcon = createSvgIcon(
<>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M8.24766 7.29507H5.76225L4.55161 15.5049H4.00003V16.7049H5.58763L6.79827 8.49507H7.17962C7.5198 10.9613 8.28557 12.9146 9.3044 14.2996C10.3952 15.7823 11.8033 16.6422 13.2842 16.6959C14.7754 16.75 16.1962 15.9814 17.2857 14.5041C18.3008 13.1277 19.0459 11.1212 19.357 8.49507H20V7.29507H18.27L18.2195 7.83969C17.9642 10.5937 17.2352 12.5508 16.32 13.7918C15.41 15.0257 14.3372 15.5333 13.3276 15.4967C12.3077 15.4597 11.208 14.8621 10.271 13.5885C9.33466 12.3156 8.58805 10.396 8.30633 7.82961L8.24766 7.29507ZM9.59081 8.92951C9.79387 8.92951 9.92222 8.96947 10.0202 9.01772C10.1312 9.07245 10.2266 9.1478 10.378 9.27255L10.3866 9.27963C10.6965 9.53507 11.1265 9.88951 11.9208 9.88951C12.7156 9.88951 13.1478 9.53478 13.4594 9.27912L13.4664 9.27335C13.7393 9.0494 13.8916 8.92951 14.2508 8.92951C14.6101 8.92951 14.7623 9.0494 15.0352 9.27335L15.0423 9.27912C15.3538 9.53478 15.7861 9.88951 16.5808 9.88951V8.68951C16.2216 8.68951 16.0693 8.56961 15.7964 8.34566L15.7894 8.33989C15.4778 8.08424 15.0456 7.72951 14.2508 7.72951C13.4561 7.72951 13.0238 8.08424 12.7123 8.33989L12.7052 8.34566C12.4323 8.56961 12.2801 8.68951 11.9208 8.68951C11.5625 8.68951 11.4131 8.57056 11.1411 8.34646L11.1284 8.33593C10.9894 8.22135 10.7971 8.06279 10.5505 7.94129C10.2832 7.80955 9.97276 7.72951 9.59081 7.72951V8.92951Z"
fill="black"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M10.0294 12.244V10.9703C10.1992 11.0069 10.3527 11.0621 10.4941 11.1318C10.7407 11.2533 10.933 11.4119 11.0719 11.5264L11.0719 11.5264L11.0847 11.537C11.3567 11.7611 11.506 11.88 11.8644 11.88C12.2236 11.88 12.3759 11.7601 12.6488 11.5362L12.6558 11.5304C12.9674 11.2747 13.3996 10.92 14.1944 10.92C14.9892 10.92 15.4214 11.2747 15.733 11.5304L15.74 11.5362C15.8487 11.6254 15.9383 11.6981 16.0294 11.7533V13.029C15.5367 12.9217 15.2255 12.6663 14.9858 12.4696L14.9788 12.4639C14.7059 12.2399 14.5536 12.12 14.1944 12.12C13.8351 12.12 13.6829 12.2399 13.41 12.4639L13.403 12.4696C13.0914 12.7253 12.6592 13.08 11.8644 13.08C11.0701 13.08 10.6401 12.7256 10.3302 12.4701L10.3302 12.4701L10.3216 12.4631C10.2006 12.3634 10.1154 12.2952 10.0294 12.244Z"
fill="black"
/>
</>,
"ReservoirFloodingRisk",
);
1 change: 1 addition & 0 deletions extension/src/prototypes/ui-components/icons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export * from "./HighTideRiskIcon";
export * from "./HistoryIcon";
export * from "./InfoIcon";
export * from "./InlandFloodingRiskIcon";
export * from "./ReservoirFloodingRiskIcon";
export * from "./KeyboardMovementIcon";
export * from "./LandmarkIcon";
export * from "./LandSlideRiskIcon";
Expand Down
3 changes: 3 additions & 0 deletions extension/src/prototypes/view-layers/layerTypeIcons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
ParkIcon,
PedestrianIcon,
RailwayIcon,
ReservoirFloodingRiskIcon,
RiverFloodingRiskIcon,
RoadIcon,
ShelterIcon,
Expand Down Expand Up @@ -49,6 +50,7 @@ import {
PARK_LAYER,
PEDESTRIAN_LAYER,
RAILWAY_LAYER,
RESERVOIR_FLOODING_RISK_LAYER,
RIVER_FLOODING_RISK_LAYER,
ROAD_LAYER,
SHELTER_LAYER,
Expand Down Expand Up @@ -80,6 +82,7 @@ export const layerTypeIcons: Record<LayerType, ComponentType<SvgIconProps>> = {
[GLOBAL_LAYER]: UseCaseIcon,
[HIGH_TIDE_RISK_LAYER]: HighTideRiskIcon,
[INLAND_FLOODING_RISK_LAYER]: InlandFloodingRiskIcon,
[RESERVOIR_FLOODING_RISK_LAYER]: ReservoirFloodingRiskIcon,
[LAND_USE_LAYER]: LandUseIcon,
[LANDMARK_LAYER]: LandmarkIcon,
[LAND_SLIDE_RISK_LAYER]: LandSlideRiskIcon,
Expand Down
2 changes: 2 additions & 0 deletions extension/src/prototypes/view-layers/layerTypeNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
CITY_LAYER,
VEGETATION_LAYER,
WATERWAY_LAYER,
RESERVOIR_FLOODING_RISK_LAYER,
} from "./layerTypes";

// Undefined means using the name from API.
Expand All @@ -52,6 +53,7 @@ export const layerTypeNames: Record<LayerType, string | undefined> = {
[GLOBAL_LAYER]: "全球データ",
[HIGH_TIDE_RISK_LAYER]: "高潮浸水想定区域",
[INLAND_FLOODING_RISK_LAYER]: "内水浸水想定区域",
[RESERVOIR_FLOODING_RISK_LAYER]: "ため池ハザードマップ",
[LAND_USE_LAYER]: "土地利用",
[LANDMARK_LAYER]: "ランドマーク",
[LAND_SLIDE_RISK_LAYER]: "土砂災害警戒区域",
Expand Down
1 change: 1 addition & 0 deletions extension/src/prototypes/view-layers/layerTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const GENERIC_CITY_OBJECT_LAYER = "GENERIC_CITY_OBJECT_LAYER";
export const GLOBAL_LAYER = "GLOBAL_LAYER";
export const HIGH_TIDE_RISK_LAYER = "HIGH_TIDE_RISK_LAYER";
export const INLAND_FLOODING_RISK_LAYER = "INLAND_FLOODING_RISK_LAYER";
export const RESERVOIR_FLOODING_RISK_LAYER = "RESERVOIR_FLOODING_RISK_LAYER";
export const LAND_SLIDE_RISK_LAYER = "LAND_SLIDE_RISK_LAYER";
export const LAND_USE_LAYER = "LAND_USE_LAYER";
export const LANDMARK_LAYER = "LANDMARK_LAYER";
Expand Down
2 changes: 2 additions & 0 deletions extension/src/prototypes/view/constants/datasetTypeIcons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
UrbanPlanningIcon,
UseCaseIcon,
VegetationIcon,
ReservoirFloodingRiskIcon,
} from "../../ui-components";

import { PlateauDatasetType } from "./plateau";
Expand All @@ -37,6 +38,7 @@ export const datasetTypeIcons = {
[PlateauDatasetType.Global]: UseCaseIcon,
[PlateauDatasetType.HighTideRisk]: HighTideRiskIcon,
[PlateauDatasetType.InlandFloodingRisk]: InlandFloodingRiskIcon,
[PlateauDatasetType.ReservoirFloodingRisk]: ReservoirFloodingRiskIcon,
[PlateauDatasetType.Landmark]: LandmarkIcon,
[PlateauDatasetType.LandSlideRisk]: LandSlideRiskIcon,
[PlateauDatasetType.LandUse]: LandUseIcon,
Expand Down
3 changes: 3 additions & 0 deletions extension/src/prototypes/view/constants/datasetTypeLayers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
PARK_LAYER,
PEDESTRIAN_LAYER,
RAILWAY_LAYER,
RESERVOIR_FLOODING_RISK_LAYER,
RIVER_FLOODING_RISK_LAYER,
ROAD_LAYER,
SHELTER_LAYER,
Expand Down Expand Up @@ -47,6 +48,7 @@ export const datasetTypeLayers = {
[PlateauDatasetType.Global]: GLOBAL_LAYER,
[PlateauDatasetType.HighTideRisk]: HIGH_TIDE_RISK_LAYER,
[PlateauDatasetType.InlandFloodingRisk]: INLAND_FLOODING_RISK_LAYER,
[PlateauDatasetType.ReservoirFloodingRisk]: RESERVOIR_FLOODING_RISK_LAYER,
[PlateauDatasetType.Landmark]: LANDMARK_LAYER,
[PlateauDatasetType.LandSlideRisk]: LAND_SLIDE_RISK_LAYER,
[PlateauDatasetType.LandUse]: LAND_USE_LAYER,
Expand Down Expand Up @@ -79,6 +81,7 @@ export const layerDatasetTypes = {
[GLOBAL_LAYER]: PlateauDatasetType.Global,
[HIGH_TIDE_RISK_LAYER]: PlateauDatasetType.HighTideRisk,
[INLAND_FLOODING_RISK_LAYER]: PlateauDatasetType.InlandFloodingRisk,
[RESERVOIR_FLOODING_RISK_LAYER]: PlateauDatasetType.ReservoirFloodingRisk,
[LANDMARK_LAYER]: PlateauDatasetType.Landmark,
[LAND_SLIDE_RISK_LAYER]: PlateauDatasetType.LandSlideRisk,
[LAND_USE_LAYER]: PlateauDatasetType.LandUse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const datasetTypeNames: Record<PlateauDatasetType, string> = {
[PlateauDatasetType.Global]: "全球データ",
[PlateauDatasetType.HighTideRisk]: "高潮浸水想定区域",
[PlateauDatasetType.InlandFloodingRisk]: "内水浸水想定区域",
[PlateauDatasetType.ReservoirFloodingRisk]: "ため池ハザードマップモデル",
[PlateauDatasetType.Landmark]: "ランドマーク",
[PlateauDatasetType.LandSlideRisk]: "土砂災害警戒区域",
[PlateauDatasetType.LandUse]: "土地利用",
Expand Down
1 change: 1 addition & 0 deletions extension/src/prototypes/view/constants/plateau.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export enum PlateauDatasetType {
GenericCityObject = "gen",
HighTideRisk = "htd",
InlandFloodingRisk = "ifld",
ReservoirFloodingRisk = "rfld",
LandSlideRisk = "lsld",
LandUse = "luse",
Landmark = "landmark",
Expand Down
3 changes: 3 additions & 0 deletions extension/src/shared/view-layers/createViewLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
PEDESTRIAN_LAYER,
PedestrianLayerModelParams,
RAILWAY_LAYER,
RESERVOIR_FLOODING_RISK_LAYER,
RIVER_FLOODING_RISK_LAYER,
ROAD_LAYER,
SHELTER_LAYER,
Expand Down Expand Up @@ -77,6 +78,7 @@ export type ViewLayerModelParams<T extends LayerType> =
T extends typeof GLOBAL_LAYER ? GeneralLayerModelParams : // GenericLayerModelParams
T extends typeof HIGH_TIDE_RISK_LAYER ? GeneralLayerModelParams : // HighTideRiskLayerModelParams
T extends typeof INLAND_FLOODING_RISK_LAYER ? GeneralLayerModelParams : // InlandFloodingRiskLayerModelParams
T extends typeof RESERVOIR_FLOODING_RISK_LAYER ? GeneralLayerModelParams : // ReservoirFloodingRiskLayerModelParams
T extends typeof LAND_USE_LAYER ? GeneralLayerModelParams : // LandUseLayerModelParams :
T extends typeof LANDMARK_LAYER ? GeneralLayerModelParams : // LandmarkLayerModelParams
T extends typeof LAND_SLIDE_RISK_LAYER ? GeneralLayerModelParams : // LandSlideRiskLayerModelParams :
Expand Down Expand Up @@ -113,6 +115,7 @@ export function createViewLayer<T extends LayerType>(
case BUILDING_LAYER: return createBuildingLayer(params as BuildingLayerModelParams)
// Flood model
case INLAND_FLOODING_RISK_LAYER: return createFloodLayer(params as FloodLayerModelParams)
case RESERVOIR_FLOODING_RISK_LAYER: return createFloodLayer(params as FloodLayerModelParams)
case HIGH_TIDE_RISK_LAYER: return createFloodLayer(params as FloodLayerModelParams)
case RIVER_FLOODING_RISK_LAYER: return createFloodLayer(params as FloodLayerModelParams)
case TSUNAMI_RISK_LAYER: return createFloodLayer(params as FloodLayerModelParams)
Expand Down
2 changes: 2 additions & 0 deletions extension/src/shared/view-layers/layerComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
PARK_LAYER,
PEDESTRIAN_LAYER,
RAILWAY_LAYER,
RESERVOIR_FLOODING_RISK_LAYER,
RIVER_FLOODING_RISK_LAYER,
ROAD_LAYER,
SHELTER_LAYER,
Expand Down Expand Up @@ -59,6 +60,7 @@ export const layerComponents: LayerComponents = {
// Flood model
[HIGH_TIDE_RISK_LAYER]: FloodLayer,
[INLAND_FLOODING_RISK_LAYER]: FloodLayer,
[RESERVOIR_FLOODING_RISK_LAYER]: FloodLayer,
[RIVER_FLOODING_RISK_LAYER]: FloodLayer,
[TSUNAMI_RISK_LAYER]: FloodLayer,
// General
Expand Down
2 changes: 2 additions & 0 deletions extension/src/shared/view-layers/plateau-3dtiles/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
HIGH_TIDE_RISK_LAYER,
INLAND_FLOODING_RISK_LAYER,
RESERVOIR_FLOODING_RISK_LAYER,
RIVER_FLOODING_RISK_LAYER,
TSUNAMI_RISK_LAYER,
} from "../../../prototypes/view-layers";
Expand All @@ -9,6 +10,7 @@ import { FloodLayerType } from "./types";

export const FLOOD_LAYER_TYPES: FloodLayerType[] = [
INLAND_FLOODING_RISK_LAYER,
RESERVOIR_FLOODING_RISK_LAYER,
HIGH_TIDE_RISK_LAYER,
RIVER_FLOODING_RISK_LAYER,
TSUNAMI_RISK_LAYER,
Expand Down
2 changes: 2 additions & 0 deletions extension/src/shared/view-layers/plateau-3dtiles/types.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import {
HIGH_TIDE_RISK_LAYER,
INLAND_FLOODING_RISK_LAYER,
RESERVOIR_FLOODING_RISK_LAYER,
RIVER_FLOODING_RISK_LAYER,
TSUNAMI_RISK_LAYER,
} from "../../../prototypes/view-layers";

export type FloodLayerType =
| typeof INLAND_FLOODING_RISK_LAYER
| typeof RESERVOIR_FLOODING_RISK_LAYER
| typeof HIGH_TIDE_RISK_LAYER
| typeof RIVER_FLOODING_RISK_LAYER
| typeof TSUNAMI_RISK_LAYER;
2 changes: 2 additions & 0 deletions extension/src/shared/view-layers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
WATERWAY_LAYER,
VEGETATION_LAYER,
CITY_LAYER,
RESERVOIR_FLOODING_RISK_LAYER,
} from "../../prototypes/view-layers";
import { PedestrianLayerModel } from "../../prototypes/view-layers/PedestrianLayer";
import { SketchLayerModel } from "../../prototypes/view-layers/SketchLayer";
Expand All @@ -52,6 +53,7 @@ export interface LayerModelOverrides {
[BUILDING_LAYER]: BuildingLayerModel;
// Flood model
[INLAND_FLOODING_RISK_LAYER]: FloodLayerModel; // InlandFloodingRiskLayerModel
[RESERVOIR_FLOODING_RISK_LAYER]: FloodLayerModel; // ReservoirFloodingRiskLayerModel
[HIGH_TIDE_RISK_LAYER]: FloodLayerModel; // HighTideRiskLayerModel
[RIVER_FLOODING_RISK_LAYER]: FloodLayerModel; // RiverFloodingRiskLayerModel;
[TSUNAMI_RISK_LAYER]: FloodLayerModel; // TsunamiRiskLayerModel
Expand Down

0 comments on commit 9239934

Please sign in to comment.