Back to Prompt Library
implementation
Build the application
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Build a CityJSON Coordinate Precision and Transformation Verifier
Format
Code-aware
Lines
107
Sections
11
Linked challenge
Build a CityJSON Coordinate Precision and Transformation Verifier
Prompt source
Original prompt text with formatting preserved for inspection.
107 lines
11 sections
No variables
1 code block
## Build
Inspect CityJSON transform matrices and vertex compression precision to verify spatial fidelity. Detect degenerate surface geometries and scale anomalies before municipal GIS federation.
## User
GIS Spatial Data Coordinator
## Workflow
1. Parse CityJSON root transform object including scale and translate vector arrays.
2. Decompress integer coordinates to real-world world coordinates across vertex arrays.
3. Identify zero-area polygons, inverted normal facets, or out-of-bounds geographic coordinates.
4. Produce transformation fidelity report with recommended quantization tolerance corrections.
## Interface
Diagnostics dashboard showing coordinate transformation histograms and defective vertex listings.
## Data
Generate synthetic CityJSON files with varied transform scales and intentionally corrupted vertices.
Starter examples below are synthetic. They are not downloaded records.
## Source
[CityJSON](https://www.cityjson.org/specs/2.0.1/)
Directly implements the CityJSON Section 1 Transform Object (scale and translate arrays) and Section 3.1 vertex decoding.
## Tools
pydantic-ai, numpy, fastapi.
Pydantic AI validates strict numerical schemas for transform vectors and vertex coordinate triplets.
Local or hosted model supporting schema evaluation and structured JSON output.
## 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
- Properly verifies that scale vectors contain exactly three positive non-zero floats.
- Flags compressed vertices that produce identical real-world coordinates within single polygons.
- Outputs decompressed bounding extents matching metadata ranges.
## Starter Examples
```json
[
{
"input": {
"type": "CityJSON",
"version": "2.0",
"transform": {
"scale": [
0.001,
0.001,
0.001
],
"translate": [
10000,
20000,
0
]
},
"vertices": [
[
0,
0,
0
],
[
1000,
0,
0
],
[
1000,
1000,
0
]
]
},
"expected_output": {
"transform_valid": true,
"vertex_count": 3,
"degenerate_polygons": 0,
"status": "VALID_GEOMETRY"
}
},
{
"input": {
"type": "CityJSON",
"version": "2.0",
"transform": {
"scale": [
0,
0.001,
0.001
],
"translate": [
0,
0,
0
]
},
"vertices": [
[
10,
20,
30
]
]
},
"expected_output": {
"transform_valid": false,
"vertex_count": 1,
"degenerate_polygons": 0,
"status": "INVALID_SCALE_VECTOR"
}
}
]
```
## Safety
Geometric validation processes geospatial metadata only and modifies no external physical municipal databases.
Use mock external writes. Require human review before any real deployment.Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.