-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
We could easily generate binary polygon data here:
deck.gl-raster/packages/deck.gl-raster/src/raster-debug-layer.ts
Lines 151 to 177 in 4a28770
| function reprojectorToTriangles( | |
| reprojector: RasterReprojector, | |
| ): ParsedTriangle[] { | |
| const positions = reprojector.exactOutputPositions; | |
| const triangles = reprojector.triangles; | |
| const trianglePolygons: ParsedTriangle[] = []; | |
| for (let triangleIdx = 0; triangleIdx < triangles.length / 3; ++triangleIdx) { | |
| const a = triangles[triangleIdx * 3]!; | |
| const b = triangles[triangleIdx * 3 + 1]!; | |
| const c = triangles[triangleIdx * 3 + 2]!; | |
| const coords = [ | |
| [positions[a * 2]!, positions[a * 2 + 1]!], | |
| [positions[b * 2]!, positions[b * 2 + 1]!], | |
| [positions[c * 2]!, positions[c * 2 + 1]!], | |
| [positions[a * 2]!, positions[a * 2 + 1]!], | |
| ]; | |
| trianglePolygons.push({ | |
| idx: triangleIdx, | |
| geom: coords, | |
| }); | |
| } | |
| return trianglePolygons; | |
| } |
Metadata
Metadata
Assignees
Labels
No labels