Summary
Issue: Exporting Roads and Buildings layers from QGIS to Blender via SHP files results in incomplete or empty .glb files.
Layers Affected:
- Roads: Visible in Blender but exports as an empty
.glb. - Buildings: Only a fraction of buildings import into Blender.
Boundary Layer: Imports and exports correctly.
Root Cause
- Roads: Missing geometry data or unsupported attributes during
.glbexport. - Buildings: Incomplete import due to large file size, complex geometries, or encoding issues in the SHP file.
Why This Happens in Real Systems
- Data Complexity: SHP files may contain unsupported attributes or geometries that BlenderGIS struggles to process.
- Export Limitations: BlenderGIS may not handle large datasets efficiently, leading to partial imports or exports.
- GLTF/GLB Constraints: The
.glbformat has strict requirements for geometry and metadata, which may not align with the exported SHP data.
Real-World Impact
- Angular Framework Integration: Incomplete
.glbfiles render the 3D map unusable in the Angular application. - Development Delays: Requires additional debugging and rework to ensure data integrity.
- User Experience: Missing or incomplete data degrades the quality of the 3D visualization.
Example or Code (if necessary and relevant)
# Example: Simplifying geometries in QGIS before export
from qgis.core import QgsGeometry, QgsFeature
layer = QGIS.utils.iface.activeLayer()
for feature in layer.getFeatures():
geom = feature.geometry()
simplified_geom = geom.simplify(0.1) # Simplify geometry
feature.setGeometry(simplified_geom)
layer.updateFeature(feature)
How Senior Engineers Fix It
- Simplify Geometries: Use QGIS tools to reduce complexity before exporting to SHP.
- Validate Data: Ensure SHP files meet GLTF/GLB requirements using validators like gltf-validator.
- Alternative Export Formats: Export to
.objor.fbxand convert to.glbusing dedicated tools likeBlenderorThree.js. - Batch Processing: Split large datasets into smaller chunks for smoother imports.
Why Juniors Miss It
- Lack of Format Knowledge: Unfamiliarity with GLTF/GLB constraints and SHP limitations.
- Overlooking Data Validation: Failure to check for missing geometries or unsupported attributes.
- Inefficient Workflows: Not simplifying or optimizing data before export.