All Products
Search
Document Center

PolarDB:ST_ImportIFC

Last Updated:Mar 28, 2026

Imports an Industry Foundation Classes (IFC) file into a database and creates three structured tables for IFC objects, geometry, and materials.

Syntax

Syntax 1: Import from object storage

boolean ST_ImportIFC(cstring prefix, cstring url, cstring options default '{}');

Syntax 2: Import from binary data

boolean ST_ImportIFC(cstring prefix, bytea content, cstring options default '{}');

Parameters

ParameterDescription
prefixThe prefix of the IFC tables created by this function.
urlThe path to the IFC file in an object storage service, such as an Object Storage Service (OSS) bucket. For the supported path formats, see Object storage paths.
contentThe binary content of the IFC file. Use this parameter to import IFC data directly from memory instead of reading from object storage.
optionsThe import options in JSON format. Default value: {}.

`options` fields

FieldTypeDefaultDescription
schemaStringpublicThe schema name of the destination tables.
projectStringThe project name. The value is written to the project_name field of every imported record.

Description

ST_ImportIFC parses an IFC file and loads its contents into three database tables prefixed with the value of prefix. The function supports two input modes:

  • Object storage: Pass a URL pointing to an IFC file in an OSS bucket or another supported object storage service.

  • Binary data: Pass the raw binary content of an IFC file loaded into memory.

Limitations

The following IFC data types are not imported:

  • IfcOpeningElement — data of this type is ignored.

  • Orphan nodes that cannot be attached to the IfcProject node are ignored.

  • IfcElementType — data of this type is temporarily ignored.

Output tables

After a successful import, the function creates three tables in the database.

IFC object table

Table name: [prefix]_ifc_elem

Stores all IFC objects and their attributes.

FieldTypeDescription
idserialThe row ID.
familytextThe IFC family of the component. In most cases, the value is IfcBuildingElement or IfcSpatialStructureElement.
project_uuidtextThe UUID of the root node (IfcProject) in the IFC file.
project_nametextThe project name set via the project option. Empty if not specified.
parent_uuidtextThe UUID of the parent component. For components of the IfcProject type, the value is root.
uuidtextThe UUID of the component, matching its UUID in the source IFC file.
nametextThe name of the component, inherited from the Name attribute of IfcRoot.
attrsjsonbThe fixed attributes of the component.
props_setjsonbThe non-fixed property set of the component. For details, see IfcRelDefinesByProperties.
elementsfmeshThe mesh geometry of the component.

Geometry component table

Table name: [prefix]_ifc_geom_elem

Stores all geometric objects in the IFC file.

FieldTypeDescription
idserialThe row ID.
project_uuidtextThe UUID of the project, matching project_uuid in the IFC object table.
project_nametextThe project name. Empty if not specified.
geometry_idtextThe geometry ID of the component, derived from its geometric and material characteristics.
geom_elementsfmeshThe geometry data of the component.

IFC material table

Table name: [prefix]_ifc_material_elem

Stores all material objects referenced in the IFC file.

FieldTypeDescription
idserialThe row ID.
project_uuidtextThe UUID of the project, matching project_uuid in the IFC object table.
project_nametextThe project name. Empty if not specified.
material_nametextThe name of the material.
material_elementmaterialThe material data of the component.

Examples

Example 1: Import from OSS without specifying a project name

SELECT ST_ImportIFC('Building', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/path_to_ifc');

Output:

---------
t

Example 2: Import from OSS with a project name

SELECT ST_ImportIFC('Building', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/path_to_ifc', '{"project":"building_1"}');

Output:

---------
t

Both examples use the OSS internal endpoint for the China (Beijing) region. Replace <ak> and <ak_secret> with your AccessKey ID and AccessKey Secret, and replace mybucket/path_to_ifc with the actual bucket name and file path.