Skip to main content
Loading navigation
Back to prompt library

Build a CityJSON 2.0 Material and Texture Appearance Auditor — implementation

Linked challenge: Build a CityJSON 2.0 Material and Texture Appearance Auditor

Prompt source

implementation95 lines11 sectionsNo variables1 code block
## Build
Inspect 3D city models in CityJSON 2.0 format to verify surface material and texture definitions. Flag missing material mapping indices and calculate surface solar reflectance values for urban cooling studies.

## User
Urban digital twin specialist

## Workflow
1. Parse CityJSON 2.0 Appearance objects containing materials and textures.
2. Verify material mapping arrays across CityObject surface boundaries.
3. Extract solar reflectance and thermal emissivity values from assigned surface materials.
4. Generate a diagnostic report flagging untextured surfaces and albedo inconsistencies.

## Interface
Web 3D surface inspector displaying polygon material shaders and reflectance heatmaps.

## Data
Download CityJSON files with appearance definitions from the 3DCityDB sample repository or construct mock CityJSON appearance objects.
Starter examples below are synthetic. They are not downloaded records.

## Source
[CityJSON](https://www.cityjson.org/specs/2.0.1/)
Implements CityJSON Section 1 & Section 6 Appearance Object specifications for surface textures and materials.

## Tools
haystack, pydantic, fastapi.
Haystack coordinates multi-step data pipelines and property document retrieval across urban material libraries.
Hosted general LLM capable of evaluating JSON data structures and physical surface material properties.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Verifies that material indices in boundary surfaces map to declared appearance materials.
- Calculates area-weighted mean surface albedo for audited building envelopes.
- Flags geometries referencing non-existent material identifiers.

## Starter Examples
```json
[
  {
    "input": {
      "appearance": {
        "materials": [
          {
            "name": "CoolRoofMembrane",
            "diffuseColor": [
              0.9,
              0.9,
              0.9
            ],
            "solar_reflectance": 0.82
          }
        ]
      },
      "building_surface": {
        "id": "Roof-A1",
        "material_index": 0,
        "area_sqm": 250
      }
    },
    "expected_output": {
      "surface_id": "Roof-A1",
      "material_name": "CoolRoofMembrane",
      "solar_reflectance": 0.82,
      "status": "VALID",
      "errors": []
    }
  },
  {
    "input": {
      "appearance": {
        "materials": [
          {
            "name": "DarkAsphaltShingle",
            "diffuseColor": [
              0.1,
              0.1,
              0.1
            ],
            "solar_reflectance": 0.15
          }
        ]
      },
      "building_surface": {
        "id": "Roof-B2",
        "material_index": 4,
        "area_sqm": 120
      }
    },
    "expected_output": {
      "surface_id": "Roof-B2",
      "material_name": null,
      "solar_reflectance": null,
      "status": "INDEX_ERROR",
      "errors": [
        "Material index 4 out of bounds for appearance array of length 1"
      ]
    }
  }
]
```

## Safety
Performs read-only validation of municipal 3D models without impacting live municipal databases.
Use mock external writes. Require human review before any real deployment.