From 0d107760e44e089779728b066b578be44bca86d3 Mon Sep 17 00:00:00 2001 From: Bert Temme Date: Tue, 15 Oct 2024 11:12:44 +0200 Subject: [PATCH 1/2] add check on input parameters --use_gpu_instancing or --use_i3dm cannot be used together --- README.md | 8 ++++---- src/Options.cs | 17 ++++++++++------- src/Program.cs | 6 ++++++ 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index f863e68..de3f6f9 100644 --- a/README.md +++ b/README.md @@ -83,8 +83,6 @@ Tool parameters: -q: (optional - Default: "") Query to add to the where clauses (for example: -q "id<5460019"). Be sure to check indexes when using this option. ---use_external_model: (optional - default false) Use external model instead of embedded model - --use_scale_non_uniform: (optional - default false) Use column scale_non_uniform for scaling instances --max_features_per_tile (optional - default 1000). Maximum number of features/instances of tile @@ -93,9 +91,11 @@ Tool parameters: --use_gpu_instancing (optional - default false) Use GPU instancing (only for Cesium) ---use_i3dm (optional - default false) Use I3dm format - only first model will be processed (false creates Cmpt) - --boundingvolume_heights (option - default: 0,10) - Tile boundingVolume heights (min, max) in meters. The heights will be added to the z_min and z_max values of the input geometries. + +--use_i3dm (optional - default false) Use I3dm format - only first model will be processed (false creates Cmpt - Only when creating I3dm's) + +--use_external_model: (optional - default false) Use external model instead of embedded model (Only when creating I3dm's) ``` # Docker diff --git a/src/Options.cs b/src/Options.cs index 8b8bc7e..587d9b7 100644 --- a/src/Options.cs +++ b/src/Options.cs @@ -19,12 +19,9 @@ public class Options [Option('o', "output", Required = false, Default = "./output", HelpText = "Output path")] public string Output { get; set; } - [Option("use_external_model", Required = false, Default = false, HelpText = "Use external model")] - public bool? UseExternalModel { get; set; } + [Option("boundingvolume_heights", Required = false, Default = "0,10", HelpText = "Tile boundingVolume heights (min, max) in meters")] + public string BoundingVolumeHeights { get; set; } - [Option("use_scale_non_uniform", Required = false, Default = false, HelpText = "Use scale_non_uniform")] - public bool? UseScaleNonUniform { get; set; } - [Option('q', "query", Required = false, Default = "", HelpText = "Query parameter")] public string Query { get; set; } @@ -34,11 +31,17 @@ public class Options [Option("use_gpu_instancing", Required = false, Default = false, HelpText = "Use EXT_mesh_gpu_instancing instead of I3dm's")] public bool? UseGpuInstancing { get; set; } + [Option("use_scale_non_uniform", Required = false, Default = false, HelpText = "Use scale_non_uniform")] + public bool? UseScaleNonUniform { get; set; } + + // I3dm specific options + [Option("use_i3dm", Required = false, Default = false, HelpText = "Use i3dm instead of cmpt's")] public bool? UseI3dm { get; set; } - [Option("boundingvolume_heights", Required = false, Default = "0,10", HelpText = "Tile boundingVolume heights (min, max) in meters")] - public string BoundingVolumeHeights { get; set; } + [Option("use_external_model", Required = false, Default = false, HelpText = "Use external model")] + public bool? UseExternalModel { get; set; } + } diff --git a/src/Program.cs b/src/Program.cs index df059d5..b554f7f 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -47,6 +47,12 @@ static void Main(string[] args) return; } + if ((bool)o.UseGpuInstancing && (bool)o.UseI3dm) { + Console.WriteLine("Error: GPU instancing and option --use_i3dm cannot be used together."); + Console.WriteLine("Use either --use_gpu_instancing or --use_i3dm"); + return; + } + var conn = new NpgsqlConnection(o.ConnectionString); var heightsArray = o.BoundingVolumeHeights.Split(','); From 5b1acfd400c757e35110cba9dddaf25bfe603023 Mon Sep 17 00:00:00 2001 From: Bert Temme Date: Tue, 15 Oct 2024 11:18:58 +0200 Subject: [PATCH 2/2] fix build --- src/Options.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Options.cs b/src/Options.cs index 599c653..273c0b2 100644 --- a/src/Options.cs +++ b/src/Options.cs @@ -37,9 +37,6 @@ public class Options [Option("tileset_version", Required = false, Default = "", HelpText = "Tileset version")] public string TilesetVersion { get; set; } - [Option("boundingvolume_heights", Required = false, Default = "0,10", HelpText = "Tile boundingVolume heights (min, max) in meters")] - public string BoundingVolumeHeights { get; set; } - // I3dm specific options [Option("use_i3dm", Required = false, Default = false, HelpText = "Use i3dm instead of cmpt's")]