Commit 695dfdbd authored by Andrey Filippov's avatar Andrey Filippov

fixing KML (was from teh first file in series)

parent 2eaa2039
...@@ -8839,7 +8839,7 @@ public class QuadCLT { ...@@ -8839,7 +8839,7 @@ public class QuadCLT {
IJ.d2s(0.000000001*(System.nanoTime()-this.startTime),3)+" sec, --- Free memory="+Runtime.getRuntime().freeMemory()+" (of "+Runtime.getRuntime().totalMemory()+")"); IJ.d2s(0.000000001*(System.nanoTime()-this.startTime),3)+" sec, --- Free memory="+Runtime.getRuntime().freeMemory()+" (of "+Runtime.getRuntime().totalMemory()+")");
} }
public void setGpsLla( public boolean setGpsLla(
String source_file) String source_file)
{ {
ImagePlus imp=(new JP46_Reader_camera(false)).open( ImagePlus imp=(new JP46_Reader_camera(false)).open(
...@@ -8857,7 +8857,9 @@ public class QuadCLT { ...@@ -8857,7 +8857,9 @@ public class QuadCLT {
if (imp.getProperty("LATITUDE") != null) gps_lla[0] =Double.parseDouble((String) imp.getProperty("LATITUDE")); if (imp.getProperty("LATITUDE") != null) gps_lla[0] =Double.parseDouble((String) imp.getProperty("LATITUDE"));
if (imp.getProperty("LONGITUDE") != null) gps_lla[1] =Double.parseDouble((String) imp.getProperty("LONGITUDE")); if (imp.getProperty("LONGITUDE") != null) gps_lla[1] =Double.parseDouble((String) imp.getProperty("LONGITUDE"));
if (imp.getProperty("ALTITUDE") != null) gps_lla[2] =Double.parseDouble((String) imp.getProperty("ALTITUDE")); if (imp.getProperty("ALTITUDE") != null) gps_lla[2] =Double.parseDouble((String) imp.getProperty("ALTITUDE"));
return true;
} }
return false;
} }
...@@ -8865,22 +8867,28 @@ public class QuadCLT { ...@@ -8865,22 +8867,28 @@ public class QuadCLT {
int debugLevel ) int debugLevel )
{ {
String [] sourceFiles_main=correctionsParameters.getSourcePaths(); String [] sourceFiles_main=correctionsParameters.getSourcePaths();
// String [] sourceFiles_aux=quadCLT_main.correctionsParameters.getSourcePaths(); SetChannels [] set_channels = setChannels(image_name,debugLevel); // only for specified image timestamp
setGpsLla(sourceFiles_main[0]);
String set_name = image_name; ArrayList<String> path_list = new ArrayList<String>();
if (set_name == null ) { for (int i = 0; i < set_channels.length; i++) {
QuadCLT.SetChannels [] set_channels=setChannels(debugLevel); for (int fn:set_channels[i].file_number) {
set_name = set_channels[0].set_name; path_list.add(sourceFiles_main[fn]);
}
}
for (String fname:path_list) {
if (setGpsLla(fname)) {
break;
}
} }
if (gps_lla != null) { if (gps_lla != null) {
String kml_copy_dir= correctionsParameters.selectX3dDirectory( String kml_copy_dir= correctionsParameters.selectX3dDirectory(
set_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false image_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
null, null,
true, // smart, true, // smart,
true); //newAllowed, // save true); //newAllowed, // save
double ts = Double.parseDouble(set_name.replace('_', '.')); double ts = Double.parseDouble(image_name.replace('_', '.'));
(new X3dOutput()).generateKML( (new X3dOutput()).generateKML(
kml_copy_dir+ Prefs.getFileSeparator()+set_name+".kml", // String path, kml_copy_dir+ Prefs.getFileSeparator()+image_name+".kml", // String path,
false, // boolean overwrite, false, // boolean overwrite,
"", // String icon_path, //<href>x3d/1487451413_967079.x3d</href> ? "", // String icon_path, //<href>x3d/1487451413_967079.x3d</href> ?
ts, // double timestamp, ts, // double timestamp,
......
...@@ -1724,7 +1724,13 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -1724,7 +1724,13 @@ if (debugLevel > -100) return true; // temporarily !
} }
} }
/*
for (String fname:path_list) { // path is already fiiltered fro the current (not first) set
if (quadCLT_main.setGpsLla(fname)) {
break;
}
}
// setGpsLla(quadCLT_main, )
if (quadCLT_main.gps_lla != null) { if (quadCLT_main.gps_lla != null) {
String kml_copy_dir= quadCLT_main.correctionsParameters.selectX3dDirectory( String kml_copy_dir= quadCLT_main.correctionsParameters.selectX3dDirectory(
set_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false set_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
...@@ -1739,7 +1745,8 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -1739,7 +1745,8 @@ if (debugLevel > -100) return true; // temporarily !
ts, // double timestamp, ts, // double timestamp,
quadCLT_main.gps_lla); // double [] lla) quadCLT_main.gps_lla); // double [] lla)
} }
// setGpsLla(quadCLT_aux, sourceFiles_aux[0]); */
quadCLT_main.writeKml(debugLevel ); // alos generated with x3d model
String jp4_copy_path= quadCLT_main.correctionsParameters.selectX3dDirectory( String jp4_copy_path= quadCLT_main.correctionsParameters.selectX3dDirectory(
set_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false set_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment