@@ -70,6 +70,10 @@ public partial class MainWindow : Window
70
70
private readonly float cellSize = 0.5f ;
71
71
private static ConcurrentDictionary < ( int , int , int ) , byte > occupiedCells = new ( ) ;
72
72
73
+ // classification stats
74
+ static byte minClass = 255 ;
75
+ static byte maxClass = 0 ;
76
+
73
77
// plugins
74
78
string externalFileFormats = "" ;
75
79
@@ -198,6 +202,10 @@ private async void Main()
198
202
// get elapsed time using time
199
203
var startTime = DateTime . Now ;
200
204
205
+ // classification minmax
206
+ minClass = 255 ;
207
+ maxClass = 0 ;
208
+
201
209
// if have files, process them
202
210
if ( importSettings . errors . Count == 0 )
203
211
{
@@ -753,12 +761,6 @@ static bool ParseFile(ImportSettings importSettings, int fileIndex, int? taskId,
753
761
return false ;
754
762
}
755
763
756
- if ( importSettings . importMetadata == true )
757
- {
758
- var metaData = taskReader . GetMetaData ( importSettings , fileIndex ) ;
759
- lasHeaders . Add ( metaData ) ;
760
- }
761
-
762
764
if ( importSettings . importMetadataOnly == false )
763
765
{
764
766
int fullPointCount = taskReader . GetPointCount ( ) ;
@@ -957,10 +959,16 @@ static bool ParseFile(ImportSettings importSettings, int fileIndex, int? taskId,
957
959
if ( importSettings . importClassification == true )
958
960
{
959
961
classification = taskReader . GetClassification ( ) ;
960
- //classification = taskReader.GetIntensity();
962
+
963
+ // get min and max
964
+ if ( classification < minClass ) minClass = classification ;
965
+ if ( classification > maxClass ) maxClass = classification ;
966
+
967
+ //classification = (byte)255;
968
+
961
969
//if (classification<0 || classification>1) Log.Write("****: " + classification.ToString());
962
970
963
- //if (i < 20000 ) Log.Write("class: " + classification.ToString());
971
+ //if (i < 10000 ) Log.Write("class: " + classification.ToString() + " minClass: " + minClass + " maxClass: " + maxClass );
964
972
//classification = 0;
965
973
//if (intensity.r < minInt)
966
974
//{
@@ -1023,7 +1031,27 @@ static bool ParseFile(ImportSettings importSettings, int fileIndex, int? taskId,
1023
1031
1024
1032
//Log.Write(jsonString, LogEvent.File);
1025
1033
1026
- } // if importMetadataOnly == false
1034
+ if ( importSettings . importMetadata == true )
1035
+ {
1036
+ var metaData = taskReader . GetMetaData ( importSettings , fileIndex ) ;
1037
+ // NOTE now its added to every file..
1038
+ metaData . ConverterVersion = version ;
1039
+ metaData . MinClassification = minClass ;
1040
+ metaData . MaxClassification = maxClass ;
1041
+ lasHeaders . Add ( metaData ) ;
1042
+ }
1043
+
1044
+ } // if importMetadataOnly == false ^
1045
+ else // only metadata:
1046
+ {
1047
+ if ( importSettings . importMetadata == true )
1048
+ {
1049
+ var metaData = taskReader . GetMetaData ( importSettings , fileIndex ) ;
1050
+ // NOTE now its added to every file..
1051
+ metaData . ConverterVersion = version ;
1052
+ lasHeaders . Add ( metaData ) ;
1053
+ }
1054
+ }
1027
1055
1028
1056
//Log.Write("taskid: " + taskId + " done");
1029
1057
return true ;
0 commit comments