Skip to content

Commit

Permalink
add check on input parameters --use_gpu_instancing or --use_i3dm cann…
Browse files Browse the repository at this point in the history
…ot be used together
  • Loading branch information
bertt committed Oct 15, 2024
1 parent 8b14560 commit 0d10776
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
17 changes: 10 additions & 7 deletions src/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand All @@ -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; }

}


Expand Down
6 changes: 6 additions & 0 deletions src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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(',');
Expand Down

0 comments on commit 0d10776

Please sign in to comment.