@@ -152,18 +152,29 @@ public static ImportSettings Parse(string[] args, string rootFolder, ILogger log
152
152
153
153
string importFormatParsed = param . ToUpper ( ) ;
154
154
155
- // TODO check what reader interfaces are available
156
- if ( string . IsNullOrEmpty ( importFormatParsed ) == true || ( importFormatParsed != "LAS " && importFormatParsed != "LAZ " ) )
155
+ if ( string . IsNullOrEmpty ( importFormatParsed ) ||
156
+ ( importFormatParsed != "LAS" && importFormatParsed != "LAZ " && importFormatParsed != "PLY " ) )
157
157
{
158
158
importSettings . errors . Add ( "Unsupported import format: " + param ) ;
159
159
importSettings . importFormat = ImportFormat . Unknown ;
160
160
}
161
161
else
162
162
{
163
- importSettings . importFormat = ImportFormat . LAS ;
164
- importSettings . reader = new LAZ ( null ) ;
163
+ switch ( importFormatParsed )
164
+ {
165
+ case "LAS" :
166
+ case "LAZ" :
167
+ importSettings . importFormat = ImportFormat . LAS ;
168
+ importSettings . reader = new LAZ ( null ) ;
169
+ break ;
170
+ case "PLY" :
171
+ importSettings . importFormat = ImportFormat . PLY ;
172
+ importSettings . reader = new PLY ( ) ;
173
+ break ;
174
+ }
165
175
}
166
176
break ;
177
+
167
178
case "-exportformat" :
168
179
Log . Write ( "exportformat = " + param ) ;
169
180
@@ -234,7 +245,7 @@ public static ImportSettings Parse(string[] args, string rootFolder, ILogger log
234
245
235
246
// TODO get file extension from commandline param? but then need to set -format before input.. for now only LAS/LAZ
236
247
// TODO parse/sort args in required order, not in given order
237
- var filePaths = Directory . GetFiles ( param ) . Where ( file => Regex . IsMatch ( file , @"^.+\.(las|laz)$" , RegexOptions . IgnoreCase ) ) . ToArray ( ) ;
248
+ var filePaths = Directory . GetFiles ( param ) . Where ( file => Regex . IsMatch ( file , @"^.+\.(las|laz|ply )$" , RegexOptions . IgnoreCase ) ) . ToArray ( ) ;
238
249
239
250
240
251
for ( int j = 0 ; j < filePaths . Length ; j ++ )
@@ -854,9 +865,9 @@ public static ImportSettings Parse(string[] args, string rootFolder, ILogger log
854
865
{
855
866
importSettings . errors . Add ( "(E) PCROOT Requires some output filename (example: output.pcroot)" ) ;
856
867
}
857
- if ( importSettings . exportFormat == ExportFormat . External )
868
+ if ( importSettings . exportFormat == ExportFormat . External && importSettings . batch == false )
858
869
{
859
- importSettings . errors . Add ( "(E2) External formats require some output filename (example: basefilename)" ) ;
870
+ importSettings . errors . Add ( "(E2) External formats require some output filename for non-batch operations (example: basefilename)" ) ;
860
871
}
861
872
}
862
873
}
@@ -938,6 +949,12 @@ public static ImportSettings Parse(string[] args, string rootFolder, ILogger log
938
949
Log . Write ( "No import format defined, using Default: " + importSettings . importFormat . ToString ( ) ) ;
939
950
}
940
951
952
+ if ( importSettings . importFormat == ImportFormat . PLY )
953
+ {
954
+ if ( importSettings . importIntensity || importSettings . importClassification ) Log . Write ( "PLY doesnt support intensity or classification importing." ) ;
955
+ if ( importSettings . packColors ) Log . Write ( "PLY doesnt support color packing." ) ;
956
+ }
957
+
941
958
if ( importSettings . exportFormat == ExportFormat . PCROOT && importSettings . useGrid == false )
942
959
{
943
960
//importSettings.errors.Add("V3 pcroot export format requires -usegrid=true to use grid");
0 commit comments