Create a layer
Option A — Create a layer via the Spatial API
Prerequisites
1) Create create-layer.ts
create-layer.tsimport "dotenv/config";
import GospaceAI from "@gospace-ai/api";
async function main() {
const gospace = new GospaceAI(process.env.GOSPACE_API_KEY!);
const res = await gospace.spatial.createLayers({
layers: [
{
location_id: "loc_123", // required: your existing location
name: "Level 1", // required: layer name
// external_id: "level-1", // optional
// ...include any other fields your schema supports
},
],
});
console.log(JSON.stringify(res.data, null, 2));
}
main().catch((err) => {
console.error("Request failed:", err);
process.exit(1);
});Option B — Create a layer by uploading a floorplan (System API)
DXF File requirements
1) Supported Layers & Geometry
Layer name
Geometry
Required
Purpose
2) Hierarchy & Containment Expectations
3) Naming Conventions (recommended)
4) How DXF Layers Map in GoSpace
DXF layer
GoSpace entity
Notes
5) Export Checklist (AutoCAD/BricsCAD/etc.)
6) Common Validation Errors
Example DXF
Last updated
Was this helpful?