Skip to content

Commit

Permalink
Merge pull request #76 from Geodan/add_check_input_parameters
Browse files Browse the repository at this point in the history
add check on input parameters --use_gpu_instancing or --use_i3dm cann…
  • Loading branch information
bertt authored Oct 15, 2024
2 parents b29f8ba + 5b1acfd commit 46190bf
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
9 changes: 5 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,11 +91,14 @@ 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.
--tileset_version (optional - default "") - Tileset version
--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
21 changes: 11 additions & 10 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,15 +31,19 @@ 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_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_scale_non_uniform", Required = false, Default = false, HelpText = "Use scale_non_uniform")]
public bool? UseScaleNonUniform { get; set; }

[Option("tileset_version", Required = false, Default = "", HelpText = "Tileset version")]
public string TilesetVersion { 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("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 @@ -52,6 +52,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 46190bf

Please sign in to comment.