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.
|
Description
The function is used to import an IFC file into a database.
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:
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