Back to prompt library
Build a CityJSON Cadastral Boundary Validator — implementation
Linked challenge: Build a CityJSON Cadastral Boundary Validator
Prompt source
implementation133 lines11 sectionsNo variables1 code block
## Build
Examine land parcel boundaries and building footprints inside CityJSON models to verify setback distances. Detect encroachments across municipal property lines and produce zoning compliance reports.
## User
Municipal Land Records Examiner
## Workflow
1. Extract 2D building footprints and LandUse parcel geometries from CityJSON dataset.
2. Calculate minimum Euclidean distance between exterior building vertices and parcel limits.
3. Compare computed distances against mandatory front, rear, and side setback regulations.
4. Compile infraction summary highlighting encroaching vertices for planning authority.
## Interface
Map viewer displaying parcel polygons, building bounds, setback violation buffers, and report log.
## Data
Synthetic CityJSON parcels generated from standard CityJSON v2.0 coordinate and LandUse schemas.
Starter examples below are synthetic. They are not downloaded records.
## Source
[CityJSON](https://www.cityjson.org/specs/2.0.1/)
Extracts LandUse and Building CityObjects along with coordinate vertices and transform scale factors as defined in CityJSON 2.0.
## Tools
qdrant, shapely, fastapi.
Qdrant stores spatial attribute embeddings and zoning regulations to rapidly match local setback rules.
Local or cloud LLM with strong geometric validation and structured report drafting abilities.
## 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
- Decompresses CityJSON vertex integer coordinates using scale and translate factors.
- Computes horizontal setback distance between building polygon and lot boundary.
- Flags setback breaches less than the statutory 3.0m municipal buffer limit.
## Starter Examples
```json
[
{
"input": {
"parcel_id": "LOT-441",
"parcel_polygon": [
[
0,
0
],
[
20,
0
],
[
20,
30
],
[
0,
30
]
],
"building_id": "BLDG-441",
"building_polygon": [
[
4,
4
],
[
16,
4
],
[
16,
24
],
[
4,
24
]
],
"min_required_setback_m": 3
},
"expected_output": {
"compliant": true,
"measured_min_setback_m": 4,
"encroachment_detected": false,
"status": "APPROVED"
}
},
{
"input": {
"parcel_id": "LOT-442",
"parcel_polygon": [
[
0,
0
],
[
20,
0
],
[
20,
30
],
[
0,
30
]
],
"building_id": "BLDG-442",
"building_polygon": [
[
1.5,
4
],
[
17,
4
],
[
17,
25
],
[
1.5,
25
]
],
"min_required_setback_m": 3
},
"expected_output": {
"compliant": false,
"measured_min_setback_m": 1.5,
"encroachment_detected": true,
"status": "VIOLATION_SETBACK"
}
}
]
```
## Safety
Encroachment warnings are purely advisory; official boundary determinations require licensed land surveyor sign-off.
Use mock external writes. Require human review before any real deployment.