fix: keep SGS hall fallback metadata preview-only
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -393,6 +393,7 @@ const createHallEntrance = (
|
||||
) => {
|
||||
const floorId = stringifyId(place.floorId) || fallbackFloorId
|
||||
const placeId = stringifyId(place.id || place.nodeId)
|
||||
const routeNodeId = stringifyId(place.nodeId) || undefined
|
||||
|
||||
return {
|
||||
id: placeId ? `hall-entrance-${placeId}` : `hall-entrance-${floorId}-${normalizedHallName(place.name)}`,
|
||||
@@ -400,9 +401,9 @@ const createHallEntrance = (
|
||||
floorId,
|
||||
floorLabel: floorLabelForSgs(floorId, floors, place.floorCode, place.floorName),
|
||||
positionGltf: normalizePlacePosition(place),
|
||||
sourceObjectName: stringifyId(place.nodeId) || undefined,
|
||||
sourcePlaceId: placeId || undefined,
|
||||
routeNodeId: stringifyId(place.nodeId) || undefined
|
||||
sourceObjectName: routeNodeId || undefined,
|
||||
sourcePlaceId: routeNodeId ? placeId || undefined : undefined,
|
||||
routeNodeId
|
||||
}
|
||||
}
|
||||
|
||||
@@ -469,7 +470,13 @@ export const toMuseumHallPoisFromSgs = (
|
||||
const entrance = createHallEntrance(place, floors, fallbackFloorId)
|
||||
const entranceHasRouteAnchor = Boolean(entrance.positionGltf && entrance.routeNodeId)
|
||||
const fallbackPosition = matchedSpace ? normalizeSpaceCenter(matchedSpace) : undefined
|
||||
const floorId = entrance.floorId || stringifyId(matchedSpace?.floorId) || fallbackFloorId
|
||||
const fallbackFloorIdForPoi = stringifyId(matchedSpace?.floorId) || entrance.floorId || fallbackFloorId
|
||||
const fallbackFloorLabel = floorLabelForSgs(
|
||||
fallbackFloorIdForPoi,
|
||||
floors,
|
||||
matchedSpace?.floorCode,
|
||||
matchedSpace?.floorName || matchedSpace?.name
|
||||
)
|
||||
const hallId = stringifyId(matchedSpace?.id) || undefined
|
||||
const poiId = createHallPoiId(matchedSpace, place, index)
|
||||
const hallName = normalizedText(matchedSpace?.name) || placeHallName(place) || entrance.name
|
||||
@@ -482,7 +489,7 @@ export const toMuseumHallPoisFromSgs = (
|
||||
]
|
||||
if (entranceHasRouteAnchor) {
|
||||
existing.positionGltf = entrance.positionGltf
|
||||
existing.floorId = floorId
|
||||
existing.floorId = entrance.floorId
|
||||
existing.floorLabel = entrance.floorLabel
|
||||
existing.sourceObjectName = entrance.sourceObjectName
|
||||
existing.sourcePlaceId = entrance.sourcePlaceId
|
||||
@@ -492,10 +499,9 @@ export const toMuseumHallPoisFromSgs = (
|
||||
|
||||
if (!existing.positionGltf && fallbackPosition) {
|
||||
existing.positionGltf = fallbackPosition
|
||||
existing.floorId = floorId
|
||||
existing.floorLabel = entrance.floorLabel
|
||||
existing.floorId = fallbackFloorIdForPoi
|
||||
existing.floorLabel = fallbackFloorLabel
|
||||
existing.sourceObjectName = matchedSpace?.sourceNodeName || undefined
|
||||
existing.sourcePlaceId = entrance.sourcePlaceId
|
||||
existing.sourceConfidence = 'backend-sgs-sdk-space-center'
|
||||
}
|
||||
return
|
||||
@@ -507,8 +513,8 @@ export const toMuseumHallPoisFromSgs = (
|
||||
halls.set(poiId, {
|
||||
id: poiId,
|
||||
name: hallName,
|
||||
floorId,
|
||||
floorLabel: entrance.floorLabel,
|
||||
floorId: entranceHasRouteAnchor ? entrance.floorId : fallbackFloorIdForPoi,
|
||||
floorLabel: entranceHasRouteAnchor ? entrance.floorLabel : fallbackFloorLabel,
|
||||
primaryCategory: hallCategory,
|
||||
categories: [
|
||||
hallCategory,
|
||||
@@ -527,7 +533,7 @@ export const toMuseumHallPoisFromSgs = (
|
||||
hallId,
|
||||
hallName,
|
||||
spaceId: hallId,
|
||||
sourcePlaceId: entrance.sourcePlaceId,
|
||||
sourcePlaceId: entranceHasRouteAnchor ? entrance.sourcePlaceId : undefined,
|
||||
sourceSpaceId: hallId,
|
||||
entrances: [entrance]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user