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 Land Use and Bounding Setback Auditor
Format
Code-aware
Lines
97
Sections
11
Linked challenge
Build a CityJSON Land Use and Bounding Setback Auditor
Prompt source
Original prompt text with formatting preserved for inspection.
97 lines
11 sections
No variables
1 code block
## Build
Parse CityJSON 2.0 LandUse and Building objects to evaluate parcel boundary compliance. Compute structural setbacks from geographicalExtent coordinates to flag municipal zoning buffer infringements.
## User
Municipal Zoning Officer
## Workflow
1. Ingest CityJSON 2.0 files containing LandUse parcels and Building footprint geometries.
2. Extract 2D bounding polygon coordinates from geographicalExtent and surface boundary indices.
3. Calculate minimum Euclidean distance between building footprint edges and parcel boundary lines.
4. Generate a structured zoning infraction docket highlighting non-compliant setback violations.
## Interface
Zoning review console displaying parcel boundary overlays, calculated setbacks, and infraction callouts.
## Data
Use open municipal 3D city models formatted in CityJSON 2.0 or generate synthetic parcel/building pairs.
Starter examples below are synthetic. They are not downloaded records.
## Source
[CityJSON](https://www.cityjson.org/specs/2.0.1/)
Extracts LandUse objects, Building objects, and geographicalExtent bounding arrays from CityJSON 2.0 Section 2.
## Tools
pydantic-ai, shapely, FastAPI.
Pydantic AI guarantees strictly validated infraction reports and typed geometric distance records.
Fast instruction model capable of interpreting municipal zoning codes against geometric coordinates.
## 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
- Parses LandUse and Building CityObjects from standard CityJSON 2.0 payloads.
- Computes horizontal setbacks between building perimeters and parcel boundaries.
- Flags structures violating minimum required municipal setback thresholds.
## Starter Examples
```json
[
{
"input": {
"parcel_id": "PARCEL-401",
"parcel_extent": [
0,
0,
0,
50,
50,
0
],
"building_id": "BLDG-401",
"building_extent": [
6,
6,
0,
30,
30,
15
],
"required_min_setback_meters": 5
},
"expected_output": {
"parcel_id": "PARCEL-401",
"building_id": "BLDG-401",
"computed_min_setback_meters": 6,
"zoning_compliant": true,
"infractions": []
}
},
{
"input": {
"parcel_id": "PARCEL-402",
"parcel_extent": [
0,
0,
0,
40,
40,
0
],
"building_id": "BLDG-402",
"building_extent": [
2,
5,
0,
35,
35,
12
],
"required_min_setback_meters": 5
},
"expected_output": {
"parcel_id": "PARCEL-402",
"building_id": "BLDG-402",
"computed_min_setback_meters": 2,
"zoning_compliant": false,
"infractions": [
"Western setback of 2.0m violates minimum required setback of 5.0m by 3.0m"
]
}
}
]
```
## Safety
Automated checks serve as preliminary screening; final zoning permits require certified land surveyor sign-off.
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.