• R/O
  • HTTP
  • SSH
  • HTTPS

importpicture: Commit


Commit MetaInfo

Revisiónb5f3cdbba6daf1a4b8cc5286a9a3d0de8d26b191 (tree)
Tiempo2016-10-30 10:56:53
Autoryuuhayashi <hayashi.yuu@gmai...>
Commiteryuuhayashi

Log Message

FIX: 出力GPXにWPTが出力されない問題を解消

Cambiar Resumen

Diferencia incremental

--- a/importPicture/src/osm/jp/gpx/ImportPicture.java
+++ b/importPicture/src/osm/jp/gpx/ImportPicture.java
@@ -300,6 +300,7 @@ public class ImportPicture extends Thread {
300300 }
301301 }
302302 catch(ParserConfigurationException | DOMException | SAXException | IOException | ParseException | ImageReadException | ImageWriteException | IllegalArgumentException | TransformerException e) {
303+ e.printStackTrace();
303304 }
304305 }
305306
@@ -355,12 +356,12 @@ public class ImportPicture extends Thread {
355356 * <wpt lat="35.2564461" lon="139.15437809"></wpt>
356357 * </gpx>
357358 */
358- TreeMap<Long,Element> map = new TreeMap<>();
359+ TreeMap<Long,Element> map = new TreeMap<Long, Element>();
359360 TreeMap<Long,Element> mapTRKSEG = new TreeMap<>();
360361 Element trk = null;
361362 //Element maeTRKPT = null;
362363 gpx = builder.parse(gpxFile).getFirstChild();
363- Document doc = gpx.getOwnerDocument();
364+ document = gpx.getOwnerDocument();
364365 NodeList nodes = gpx.getChildNodes();
365366 for (int i=0; i < nodes.getLength(); i++) {
366367 Node node2 = nodes.item(i);
@@ -373,7 +374,7 @@ public class ImportPicture extends Thread {
373374 Node nodeTRKSEG = nodes1.item(i1);
374375 if (nodeTRKSEG.getNodeName().equals("trkseg")) {
375376 trksegCounter++;
376- Element newTRKSEG = doc.createElement("trkseg");
377+ Element newTRKSEG = document.createElement("trkseg");
377378 Element trkseg = (Element) nodeTRKSEG;
378379 NodeList nodes2 = trkseg.getChildNodes();
379380 for (int i2=0; i2 < nodes2.getLength(); i2++) {
@@ -382,10 +383,10 @@ public class ImportPicture extends Thread {
382383 if (param_GpxNoFirstNode && (i2 == 0)) {
383384 continue;
384385 }
385- newTRKSEG.appendChild(getCopy(doc, nodeTRKPT));
386+ newTRKSEG.appendChild(getCopy(document, nodeTRKPT));
386387 }
387388 }
388- mapTRKSEG.put(new Long(trksegCounter), getCopy(doc, newTRKSEG));
389+ mapTRKSEG.put(new Long(trksegCounter), getCopy(document, newTRKSEG));
389390
390391 // <trk>から<trkseg>を削除する。
391392 trk.removeChild(nodeTRKSEG);
@@ -421,6 +422,29 @@ public class ImportPicture extends Thread {
421422 gpxEndTime = gpxTime;
422423 }
423424 }
425+
426+ /*
427+ * SPEEDをGPXに設定する
428+ * 条件: SPEEDを書き出すフラグがONの時
429+ * 条件: オリジナルのSPEEDがある場合「上書きする/変更しない」(GPX_OUTPUT_SPEED)
430+ */
431+ /*
432+ TreeMap<Long,Element> map2 = new TreeMap<Long, Element>();
433+ if (Boolean.parseBoolean(params.getProperty(AppParameters.GPX_OUTPUT_SPEED))) {
434+ for (Long timeL : keySet) {
435+ Element trkptE = trkpt(map, new Date(timeL));
436+ if (trkptE != null) {
437+ map2.put(timeL, trkptE);
438+ }
439+ else {
440+ map2.put(timeL, map.get(timeL));
441+ }
442+ }
443+ }
444+ else {
445+ map2 = (TreeMap<Long, Element>) map.clone();
446+ }
447+ */
424448
425449 System.out.println("GPX start time: "+ dfjp.format(new Date(gpxStartTime)) + "\t[GMT " + dfuk.format(new Date(gpxStartTime))+"]");
426450 System.out.println(" GPX end time: "+ dfjp.format(new Date(gpxEndTime)) + "\t[GMT " + dfuk.format(new Date(gpxEndTime))+"]");
@@ -652,7 +676,7 @@ public class ImportPicture extends Thread {
652676 }
653677
654678 if (Boolean.parseBoolean(params.getProperty(AppParameters.GPX_OUTPUT_WPT))) {
655- Element temp = getCopy(gpx.getOwnerDocument(), trkptT.trkpt);
679+ Element temp = createWptTag(image, itime.getTime(), trkptT.trkpt);
656680 gpx.appendChild(temp);
657681 }
658682 }
Show on old repository browser