Floor Plan JSON Schema: Rooms, Openings and Adjacency
By Floor Plan Analyzer, an AxcelerateAI practice
A polygon array can draw a room on screen without telling your application which revision it came from, what its units mean or whether a nearby door connects to it. This reference proposes a small single-view contract and shows where additional validation belongs.

At a glance
A useful floor plan JSON model defines its coordinate frame, source evidence, stable room and opening IDs, and the relationships between them. Validate the JSON structure first, then validate references, geometry and connection semantics in the application before downstream use.
Download the illustrative JSON Schema
Choose the smallest contract your consumer can use
Start with the questions the consuming software asks. A listing application might need room labels and approximate layout. A navigation service needs verified traversable connections. An estimating workflow needs measurement rules and source-linked quantities. Agree on those meanings before choosing fields.
The downloadable schema is an illustrative Draft 2020-12 contract. It models one calibrated plan view in metres, room boundary polygons, opening spans and candidate or reviewed connections. It uses keyed objects for rooms and openings so each record has an explicit reference key. The companion sample contains two rooms and one door. Extend it deliberately for walls, floors, measurements or multiple coordinate frames.
References: Download the matching fictional JSON payload · JSON Schema Draft 2020-12 specification
Make coordinates unambiguous
The example uses a local origin with x increasing right and y increasing up. R1 occupies x = 0 to 3 and y = 0 to 4. R2 occupies x = 3 to 6 over the same height. Their boundary rings repeat the first point at the end. O1 spans from (3, 1) to (3, 2). These zero-thickness boundaries describe adjoining spaces; they do not model wall thickness or verified clear passage width.
A rendered PDF commonly uses a different coordinate convention. If extraction starts in crop pixels, retain the render size, crop offset and transformations that map those pixels into the selected plan frame. A schema containing metre coordinates does not establish that the source scale was correct. Keep calibration evidence and review it before emitting physical measurements.
For a multi-page job, add explicit frame IDs to geometry records and define transformations between frames. Never join rooms across levels using coordinate proximity alone. Keep the sheet label, zero-based PDF page index and view crop separate.
Link openings to spaces, then define connection meaning
In the sample, O1 names R1 and R2 in its spaces array. A connection record names the same opening and uses R1 and R2 as its endpoints. A window can separate two spaces without providing a walking route, so the application must check opening kind and any access evidence before building navigation.
The exterior_space_id reserves an explicit identifier for outside. A known exterior opening can use it as an endpoint. An unresolved endpoint needs its own representation in an extended contract, such as an issue record with candidate IDs. Avoid silently treating an unknown space as exterior.
Use candidate status while the relation remains uncertain. Reviewed indicates that your defined review step occurred. It does not establish accessibility, fire compliance, clearance or current access permissions. Store those as distinct sourced properties if the application requires them.
| Record | Meaning | Application check |
|---|---|---|
| rooms.R1 and rooms.R2 | Separate named spaces in one frame | Closed, simple rings and valid boundaries |
| openings.O1 | Door span on their shared boundary | Space IDs exist and span is on both boundaries |
| connections[0] | Proposed or reviewed route through O1 | Opening exists, endpoints agree and kind supports passage |
Use JSON Schema for structure and separate semantic checks
The schema declares required properties, numeric coordinate pairs and allowed status values. Internal references reuse definitions through $defs and $ref. additionalProperties is false on fixed records to catch misspelled fields. Room and opening collections allow arbitrary keys whose values must match their record definitions.
A $ref points to a schema definition. It does not verify that a string such as R1 exists in the payload’s rooms collection. In application code, build the room and opening ID sets, reject collisions with the reserved exterior ID and check every relationship. Then check ring closure, self-intersections, nonzero area and opening placement using geometry operations.
Validation should return a record path and reason, such as connections[0].opening_id referencing an absent opening. Preserve failed records with their evidence in an exception workflow and keep them out of accepted exports until resolved. Avoid repairing an invalid polygon by closing gaps without recorded evidence.
References: JSON Schema reusable definitions and references
Keep source evidence through revisions and migrations
Each sample room and opening carries sheet A101, revision 03, view main-plan and page_index 0. A production contract should add document identity or a content hash and evidence geometry or crop references. A source tag is useful evidence but may change between issues, so keep it separate from the application’s object identity.
A change in the schema version describes the data contract. A change in drawing revision describes the source. Track pipeline and mapping versions separately when reproducibility matters. Define whether an update replaces a complete snapshot or applies an explicit delta, and use stable request IDs so retries cannot duplicate objects.
Before releasing a new contract, test existing saved payloads and consumers. Adding a property to a closed record can break an older validator even if it appears additive. Keep the old version available or migrate stored records with a documented mapping, and compare geometry and references after migration.
Test a payload before integrating the extraction service
Validate the sample against the downloaded schema using a Draft 2020-12 validator. Then deliberately change a coordinate to a string, remove required source evidence and add an unexpected field. Those are structure failures. Change an endpoint to a nonexistent room and verify that your semantic checker catches it even though the JSON Schema accepts the string.
For the supplied rectangles, the shoelace area is 12 m² per room and O1 has a span length of 1 m. These are arithmetic checks on fictional coordinates. Add tests for reversed rings, crossing edges, zero-length spans, unknown endpoints and duplicated connection records as your supported scope grows.
Floor Plan Analyzer engineers extraction around the fields and workflow your software needs. Bring a sample drawing, target payload and consumer constraints so the data contract and acceptance checks can be agreed before integration.
Frequently asked questions
Is this a universal floor plan standard?
It is an illustrative single-view contract for an integration discussion. Map its coordinate and property meanings explicitly when exchanging data with BIM, GIS or another application.
Does a valid JSON payload prove the geometry is correct?
Structural validation checks declared types and constraints. Geometry, source scale, object references and intended relationships need additional checks.
Where is the API endpoint?
These downloads define a proposed output contract. A custom integration’s endpoint, authentication and request lifecycle are agreed for the project.