Table of Contents

Class PclJsonExporter

Namespace
PclIO.Export
Assembly
PclIO.dll

Exports point cloud metadata and, optionally, a bounded list of sample points as JSON.

public static class PclJsonExporter

Inheritance

Inherited Members

Remarks

Root properties: format, fileName (file or folder name only, never the full path), fileSize, totalPointCount, coordinateSystem (only when known), overallBounds (min/max arrays of three numbers, or null when unknown), metadata (keys sorted ordinally), scans (id, name, pointCount, channel flags and a transform whose vectors are arrays of three numbers), and samplePoints, which is written only when maxPoints is greater than zero. Sample points use x y z (4 decimals) plus intensity (clamped to 0..1) and r g b when present; normals are not exported. Sample points are read with default read options and at most maxPoints are written. Non-finite coordinates cannot be represented in JSON: such sample points are skipped, and non-finite numbers in bounds or transforms are written as null. Output is culture independent and is flushed to the writer in blocks while the points are streamed.

Methods

Export(PclDocument, TextWriter, bool, int?)

Writes the document as JSON and returns the number of sample points written.

public static long Export(PclDocument doc, TextWriter writer, bool indented = true, int? maxPoints = null)

Parameters

doc PclDocument

Source document.

writer TextWriter

Destination text writer; the caller owns it and must flush or dispose it.

indented bool

Whether to indent the JSON.

maxPoints int?

Maximum number of sample points to include; null or zero writes none.

Returns

long

Number of sample points written.

Export(PclDocument, TextWriter, bool, int?, out long)

Writes the document as JSON and also reports how many sample points were skipped.

public static long Export(PclDocument doc, TextWriter writer, bool indented, int? maxPoints, out long skippedPoints)

Parameters

doc PclDocument

Source document.

writer TextWriter

Destination text writer; the caller owns it and must flush or dispose it.

indented bool

Whether to indent the JSON.

maxPoints int?

Maximum number of sample points to include; null or zero writes none.

skippedPoints long

Number of sample points skipped because a coordinate was NaN or infinite.

Returns

long

Number of sample points written.