public void CanRetrieveFileFormat() { PointCloudFileFormat.Register(new PointCloudFileFormat("Test Description 2", new[] { ".test2" }, null, null)); var format = PointCloudFileFormat.FromFileName(@"C:\Data\pointcloud.test2"); Assert.IsTrue(format != null); Assert.IsTrue(format.Description == "Test Description 2"); }
public void CanRetrieveFileFormat2() { PointCloudFileFormat.Register(new PointCloudFileFormat("Test Description 3", new[] { ".test3", ".tst3" }, null, null)); var format1 = PointCloudFileFormat.FromFileName(@"C:\Data\pointcloud.test3"); var format2 = PointCloudFileFormat.FromFileName(@"C:\Data\pointcloud.tst3"); Assert.IsTrue(format1 != null && format1.Description == "Test Description 3"); Assert.IsTrue(format2 != null && format2.Description == "Test Description 3"); }
/// <summary> /// Parses file. /// Format is guessed based on file extension. /// </summary> public static IEnumerable <Chunk> Parse(string filename, ParseConfig config) { if (filename == null) { throw new ArgumentNullException(nameof(filename)); } if (!File.Exists(filename)) { throw new FileNotFoundException($"File does not exit ({filename}).", filename); } return(PointCloudFileFormat.FromFileName(filename).ParseFile(filename, config)); }
/// <summary> /// Imports file into out-of-core store. /// Format is guessed based on file extension. /// </summary> public static PointSet Import(string filename, string storeDirectory, LruDictionary <string, object> cache) { if (filename == null) { throw new ArgumentNullException(nameof(filename)); } if (!File.Exists(filename)) { throw new FileNotFoundException("File does not exit.", filename); } var config = ImportConfig.Default .WithStorage(OpenStore(storeDirectory, cache)) .WithKey(FileHelpers.ComputeMd5Hash(filename, true)) ; var result = PointCloudFileFormat.FromFileName(filename).ImportFile(filename, config); config.Storage.Flush(); return(result); }
/// <summary> /// Imports file. /// Format is guessed based on file extension. /// </summary> public static PointSet Import(string filename, ImportConfig config = null) { if (filename == null) { throw new ArgumentNullException(nameof(filename)); } if (!File.Exists(filename)) { throw new FileNotFoundException("File does not exit.", filename); } if (config == null) { config = ImportConfig.Default .WithInMemoryStore() .WithKey(FileHelpers.ComputeMd5Hash(filename, true)) ; } return(PointCloudFileFormat.FromFileName(filename).ImportFile(filename, config)); }
/// <summary></summary> public static PointSet ImportFile(this PointCloudFileFormat self, string filename, ImportConfig config) => PointCloud.Chunks(self.ParseFile(filename, config.ParseConfig), config);
/// <summary> /// Gets general info for given point cloud file. /// </summary> public static PointFileInfo ParseFileInfo(string filename, ParseConfig config) => PointCloudFileFormat.FromFileName(filename).ParseFileInfo(filename, config);
static Pts() { PtsFormat = new PointCloudFileFormat("pts", new[] { ".pts" }, PtsInfo, Chunks); PointCloudFileFormat.Register(PtsFormat); }
static Yxh() { YxhFormat = new PointCloudFileFormat("yxh", new[] { ".yxh" }, YxhInfo, Chunks); PointCloudFileFormat.Register(YxhFormat); }
static E57() { E57Format = new PointCloudFileFormat("e57", new[] { ".e57" }, E57Info, Chunks); PointCloudFileFormat.Register(E57Format); }
public void UnknownFileFormatGivesUnknown() { var format = PointCloudFileFormat.FromFileName(@"C:\Data\pointcloud.foo"); Assert.IsTrue(format == PointCloudFileFormat.Unknown); }
public void CanRegisterFileFormat() { PointCloudFileFormat.Register(new PointCloudFileFormat("Test Description 1", new[] { ".test1" }, null, null)); }
static Laszip() { LaszipFormat = new PointCloudFileFormat("LASzip", new[] { ".las", ".laz" }, LaszipInfo, Chunks); PointCloudFileFormat.Register(LaszipFormat); }