https://github.com/bertt/pnts-tile-cs
.NET 8 Library for (de)serializing LiDAR 3D tiles
https://github.com/bertt/pnts-tile-cs
Last synced: 5 months ago
JSON representation
.NET 8 Library for (de)serializing LiDAR 3D tiles
- Host: GitHub
- URL: https://github.com/bertt/pnts-tile-cs
- Owner: bertt
- License: mit
- Created: 2018-12-19T10:20:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-02-10T13:30:17.000Z (over 1 year ago)
- Last Synced: 2025-11-10T18:19:21.833Z (7 months ago)
- Language: C#
- Homepage:
- Size: 2.39 MB
- Stars: 2
- Watchers: 1
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pnts-tile-cs
.NET 8.0 Library for (de)serializing Cesium pnts tiles
[](https://www.nuget.org/packages/pnts-tile/)
Spec: https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification/TileFormats/PointCloud
3D Tiles OGC® Community Standard (pdf alert): https://portal.opengeospatial.org/files/79137
## Sample code
```
string infile = "testfixtures/1-0-1-1.pnts";
var stream = File.OpenRead(infile);
var pnts = PntsParser.ParsePnts(stream);
Console.WriteLine($"Number of points: {pnts.FeatureTableMetadata.points_length} ");
var rtc = pnts.FeatureTableMetadata.Rtc_Center;
Console.WriteLine($"RTC_CENTER (relative to center x,y,z): {rtc[0]},{rtc[1]},{rtc[2]}");
Console.WriteLine($"First point (x,y,z): {pnts.Points[0].X}, {pnts.Points[0].Y}, {pnts.Points[0].Z} ");
Console.WriteLine($"First point color (r,g,b): {pnts.Colors[0].R}, {pnts.Colors[0].G}, {pnts.Colors[0].B} ");
```
See https://github.com/bertt/pnts-tile-cs/blob/master/samples/ConsoleApp/Program.cs for sample code converting points in tile to longitude, latitude, altitude and writing to csv file.
## Positions
From the spec: "RTC_CENTER specifies the center position and all point positions are treated as relative to this value".
So for each point, add the point (x,y,z) to the RTC_CENTER to get its position in Cartesian format.
For sample code calculating to longitude, latitude, altitude see https://github.com/bertt/pnts-tile-cs/blob/master/samples/ConsoleApp/Program.cs#L19
## Dependencies
- System.Text.Json
## Known limitis
- add support for POSITION_QUANTIZED, RGBA, RGB565, NORMAL, NORMAL_OCT16P, BATCH_ID, QUANTIZED_VOLUME_OFFSET, QUANTIZED_VOLUME_SCALE, CONSTANT_RGBA,BATCH_LENGTH
- add pnts writer functionality
## History
2018-12-19: Initial coding - pnts reader