All Products
Search
Document Center

PolarDB:ST_ImportIFC

Last Updated:Jun 08, 2023

This topic describes the ST_ImportIFC function. This function is used to import an Industry Foundation Classes (IFC) file to a database.

Syntax

  • Syntax 1

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

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

Parameters

Parameter

Description

prefix

The prefix of the IFC table.

url

If the IFC file is stored in an object storage service, such as an Object Storage Service (OSS) bucket, use this parameter. For more information, see Object storage paths.

content

If you want to import the IFC file by using its binary representation, use this parameter. Alternatively, you can use the url parameter.

options

The fields for the import.

  • schema: the schema name of the destination table. Data type: String. Default value: public.

  • project: the name of the project. Data type: String. The value of this field is passed to the project_name field of each record.

Description

The function is used to import an IFC file into a database.

Note
  • The function can be used to import an IFC file that is stored in an object storage service, such as an OSS bucket, into a database.

  • The function can be used to read the binary data of an IFC file to the memory and then import the data into a database.

Import limits:

  • The data of the IfcOpeningElement type is ignored.

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

  • The data of the IfcElementType type is temporarily ignored.

After the import is successful, three tables are generated in the database:

IFC object table

Table name format: [prefix]_ifc_elem

Functionality: This table stores all actual IFC objects and their associated attributes.

Schema:

Field

Type

Description

id

serial

The ID of the table.

family

text

The family of the table.

In most cases, the table belongs to the IfcBuildingElement or IfcSpatialStructureElement family.

project_uuid

text

The ID of the project.

The UUID of the root node component in the IFC file.

project_name

text

The name of the project.

If you do not specify a value for the project_name field, the column is empty.

In most cases, the project is used to store the tables of multiple sub-projects.

parent_uuid

text

The UUID of the parent component.

If the component is of the IfcProject type, the value of the parent_uuid field is root.

uuid

text

The UUID of the component.

The value is the same as the UUID of the component in the IFC file.

name

text

The name of the component.

The value inherits the value of the Name attribute from IfcRoot.

attrs

jsonb

The fixed attributes of the component.

You can add the types and their attributes based on your business requirements.

props_set

jsonb

A non-fixed property set of the component.

For more information, see IfcRelDefinesByProperties.

element

sfmesh

The entity of the component.

Geometry component table

Table name format: [prefix]_ifc_geom_elem

Functionality: This table stores all geometric objects.

Schema:

Field

Type

Description

id

serial

The ID of the table.

project_uuid

text

The ID of the project.

The value is the same as the project ID in the IFC object table.

project_name

text

The name of the project.

If you do not specify a value for the project_name field, the column is empty.

In most cases, the project is used to store the tables of multiple sub-projects.

geometry_id

text

The geometry ID of the component.

The value consists of the geometric and material characteristics of the component.

geom_element

sfmesh

The geometry information about the component.

IFC material table

Table name format: [prefix]_ifc_material_elem

Functionality: This table stores all associated material objects.

Schema:

Field

Type

Description

id

serial

The ID of the table.

project_uuid

text

The ID of the project.

The value is the same as the project ID in the IFC object table.

project_name

text

The name of the project.

If you do not specify a value for the project_name field, the column is empty.

In most cases, the project is used to store the tables of multiple sub-projects.

material_name

text

The name of the material.

material_element

material

The material information about the component.

Examples

Example 1: The project name is not specified.

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

---------
t

Example 2: The project name is specified.

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

---------
t