This document describes the purpose and core components of GanosBase Utility and provides a quick start guide.
Purpose
Overview
Ganos Utility is a spatial-temporal engine extension for PolarDB for PostgreSQL and . This extension lets you import, export, and validate 3D models in common formats, such as OBJ, GLB, IFC, and OSGB. These functions allow you to import 3D model data into the Ganos engine for processing.
As part of the Ganos spatial-temporal engine, Ganos Utility integrates seamlessly with other engine components. You can use Ganos Utility to apply imported 3D model data directly to scenes in the Ganos spatial-temporal engine for further operations such as modeling, rendering, and simulation. This seamless integration simplifies workflows and improves development efficiency.
-
In the query editor, run the SQL statement
select name,st_affine(element,1,0,0,0,0,1,0,-1,0,0,0,0) from ifc_demo_ifc_elem where family ='IfcBuildingStorey'. The query returns eight records for building floors (Level 1 to Level 7 and Level 7A). Each record contains the floor name and the 3D mesh data transformed by the st_affine spatial function. The 3D model viewer panel on the right displays the imported Building Information Modeling (BIM) model, rendered semi-transparently. -
Import and view OSGB data. The following figure shows the result.

-
Perform field of view (FOV) analysis on OSGB data. The following figure shows the result.

Use cases
-
Import and export multiple file formats
Ganos Utility can import, export, and validate common 3D model file formats, including OBJ, GLB, IFC, and OSGB. This provides you with the flexibility to process and edit various types of 3D data.
-
Manage and view data
Ganos Utility simplifies managing and viewing 3D model data. It provides unified tools for rapid data import, editing, conversion, and export. This streamlines your workflow and improves efficiency.
-
Validate data
Ganos Utility provides functions to validate imported 3D model data. You can use these functions to check data for format, structure, and consistency, which ensures data quality and allows you to correct errors promptly.
Core components
Ganos Utility provides functions to import, export, and validate data for the sfmesh and scene modules.
Data import
-
IFC import
Industry Foundation Classes (IFC) is an open, industry-standard data model and file format for exchanging information about architecture and infrastructure projects. IFC is a standard developed by the International Organization for Standardization (ISO) to promote collaboration and integration in Building Information Modeling (BIM).
The IFC format uses an object-based data model to represent various components, attributes, and relationships in construction and infrastructure projects. It can describe a building's geometry, structure, materials, properties, and associations. The format represents not only geometric data but also information about a building's function, construction process, maintenance, and operation.
-
OBJ import
OBJ (Wavefront OBJ) is a common 3D model file format used to store and exchange the geometry and material information of static 3D models.
The OBJ data format consists of two files: a .obj file and a .mtl file. The .obj file contains a model's vertices, normals, texture coordinates, and faces. It uses a series of keywords to describe the geometric properties of the model, such as vertex coordinates (v), normal vectors (vn), and texture coordinates (vt). Face information is defined by using vertex indices to describe polygon connectivity. The .mtl file contains the model's material properties, such as color, texture, and lighting information.
-
GLB import
GLB (GLTF Binary) is a binary file format for storing and exchanging 3D models. GLB is an extension of GLTF (GL Transmission Format) that packages a model's geometry, materials, textures, animations, and other relevant data into a single binary file for more efficient loading and transmission.
The GLB format uses binary encoding, which results in smaller file sizes and faster loading speeds compared to text-based formats. This makes GLB files suitable for online 3D model transmission and real-time rendering in applications such as virtual reality (VR), augmented reality (AR), and WebGL.
-
OSGB import
OSGB is a file format for storing and loading 3D scenes. It is part of the OpenSceneGraph (OSG) framework and is used to describe and save 3D models, textures, and materials.
OSGB files are binary files. Compared with other common 3D file formats such as OBJ and FBX, OSGB files have smaller file sizes and faster loading speeds, making them ideal for handling large-scale scenes.
Data export
3D Tiles export
3D Tiles is an open standard format designed for storing and exchanging large-scale 3D geospatial data. It addresses the challenges of efficiently rendering and visualizing massive 3D datasets on web platforms, including city models, terrain, and point clouds.
3D Tiles provides a hierarchical structure for organizing and rendering tile data to support efficient map rendering and visualization. Tiles can be organized by spatial location and level of detail, allowing users to load and display data progressively. This enables high-performance browsing and interaction with large-scale geospatial data.
Data validation
OSGB validation
OSGB is a binary file format used in the OpenSceneGraph framework to store and load 3D scene data. Due to their binary nature, directly checking the data's validity can be difficult. You can use Utility functions to validate the integrity of OSGB files.
Other
For more information, see Utility SQL reference.
Quick start
Overview
This quick start guide describes the basic usage of the Ganos Utility, including how to create the extension, import data, export data, and validate data.
For advanced usage, see the GanosBase Utility best practices article: Ganos 3D engine series (3): BIM data management and visualization capabilities.
Syntax
-
Create the extension.
CREATE EXTENSION IF NOT EXISTS ganos_utility CASCADE;Note-
Install the extension into the public schema to avoid potential permission issues.
CREATE EXTENSION IF NOT EXISTS ganos_utility with schema public CASCADE; -
If you encounter an error indicating that the extension is not supported when you run the preceding statement, contact us.
-
-
Import data.
-- Import glTF data into the gltf_table table and set its ID to 1. SELECT ST_ImportGLTF('gltf_table', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/bim_wall.gltf', '1'); st_importgltf --------------- t (1 row) -- Import IFC data and generate an ifc_ifc_elem table. SELECT ST_ImportIFC('ifc', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/CE1314-ACM-C3_LA-ST07_WB-AR-M3_N.ifc'::cstring); st_importifc -------------- t (1 row) -- Import OBJ data into the obj_table table. SELECT ST_ImportOBJ('obj_table', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/obj/j3sn.obj', '1'); st_importobj -------------- t (1 row) -- Import an oblique photography project in OSGB format and save it to the osgb table. SELECT ST_ImportOSGB('osgb', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/osgb'); st_importosgb --------------- t (1 row)Note-
You must access the object storage service (OSS) over IPv6. For more information, see Object storage service paths.
-
Replace
<ak>and<ak_secret>with your AccessKey ID and AccessKey secret.
-
-
Export data.
-- Export an IFC project to the 3D Tiles format and save it to the tile table. SELECT ST_As3DTiles(element, 'tile') from ifc_ifc_elem where family = 'IfcProject'; st_as3dtiles -------------- t (1 row) -
Validate data.
-- Validate whether an oblique photography project in OSGB format is valid. SELECT * FROM ST_ValidateOSGB('OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/osgb'); valid | reason -------+-------- t | (1 row) -
Delete the extension (optional).
DROP EXTENSION ganos_utility CASCADE;
Advanced usage
Ganos Utility supports advanced parameters and lets you customize configurations.
-
IFC import
-- Import a specified project. SELECT ST_ImportIFC('Building', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/path_to_ifc'::cstring, '{"project":"building_1"}'); -- Disable parallel import. SELECT ST_ImportIFC('local', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/CE1314-ACM-C3_LA-ST07_WB-AR-M3_N.ifc'::cstring, '{"disable_multi_thread":true}'); -
OBJ import
-- Disable automatic triangulation. SELECT ST_ImportObj('test_obj', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/path_to_obj.obj', '{"force_triangulate": false}'); -
GLTF/GLB import
-- Swap the Y and Z axes during import. SELECT ST_ImportGLTF('test_gltf', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/path_to_gltf.glb', 'my_glb', '{"flip_y_z": true}'); -
OSGB import
-- Specify the degree of parallelism for the import. SELECT ST_ImportOSGB('test_osgb', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/path_to_oblique_project/', '{"parallel": 4}'); -- Use gateway mode. The database stores only paths, not data. SELECT ST_ImportOSGB('test_osgb', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/path_to_oblique_project/', '{"gateway": true}'); -
OSGB validation
-- Perform parallel validation. SELECT ST_ValidateOSGB('OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/path_to_oblique_project/', '{"parallel": 4}'); -
Export to 3D Tiles
-- Perform parallel export. SELECT ST_As3DTiles(element, 'test', '{"parallel": 4}') from ifc_ifc_elem where family = 'IfcProject'; -- Specify the tile size threshold. Geometric objects larger than this value are split. Unit: KB. SELECT ST_As3DTiles(element, 'test', '{"size_threshold": 1024}') from ifc_ifc_elem where family = 'IfcProject'; -- Specify the coordinate system for the exported 3D Tiles. SELECT ST_As3DTiles(element, 'test', '{"srid": 4326}') from ifc_ifc_elem where family = 'IfcProject'; -- Specify the spatial partitioning method for 3D Tiles. Valid values: 'oct' (octree), 'quad' (quadtree), and 'bsp' (BSP tree). SELECT ST_As3DTiles(element, 'test', '{"method": "oct"}') from ifc_ifc_elem where family = 'IfcProject';
SQL reference
For detailed information, see Utility SQL reference.