MCPcopy Index your code
hub / github.com/ColmapView/Colmapview.github.io / sortedKeys

Function sortedKeys

src/parsers/colmapWriterUtils.ts:30–37  ·  view source on GitHub ↗
(map: Map<K, unknown>)

Source from the content-addressed store, hash-verified

28 * Sort map keys numerically. COLMAP sorts entries by ID before writing.
29 */
30export function sortedKeys<K extends number | bigint>(map: Map<K, unknown>): K[] {
31 return Array.from(map.keys()).sort((a, b) => {
32 if (typeof a === 'bigint' && typeof b === 'bigint') {
33 return a < b ? -1 : a > b ? 1 : 0;
34 }
35 return Number(a) - Number(b);
36 });
37}
38
39export function toBinaryPoint3DId(id: Point3DId): bigint {
40 return id === UNMATCHED_POINT3D_ID ? COLMAP_INVALID_POINT3D_ID : id;

Callers 10

writeCamerasTextFunction · 0.90
writeImagesTextFunction · 0.90
writePoints3DTextFunction · 0.90
writeRigsTextFunction · 0.90
writeFramesTextFunction · 0.90
writeCamerasBinaryFunction · 0.90
writeImagesBinaryFunction · 0.90
writePoints3DBinaryFunction · 0.90
writeRigsBinaryFunction · 0.90
writeFramesBinaryFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected