diff --git a/AdjustTime/build.xml b/AdjustTime/build.xml new file mode 100644 index 0000000..b2796d2 --- /dev/null +++ b/AdjustTime/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project AdjustTime. + + + diff --git a/AdjustTime/manifest.mf b/AdjustTime/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/AdjustTime/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/AdjustTime/nbproject/build-impl.xml b/AdjustTime/nbproject/build-impl.xml new file mode 100644 index 0000000..84defd8 --- /dev/null +++ b/AdjustTime/nbproject/build-impl.xml @@ -0,0 +1,1413 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AdjustTime/nbproject/genfiles.properties b/AdjustTime/nbproject/genfiles.properties new file mode 100644 index 0000000..7beff30 --- /dev/null +++ b/AdjustTime/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=c9679f2a +build.xml.script.CRC32=ab56f916 +build.xml.stylesheet.CRC32=8064a381@1.75.2.48 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=c9679f2a +nbproject/build-impl.xml.script.CRC32=68212a92 +nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48 diff --git a/AdjustTime/nbproject/project.properties b/AdjustTime/nbproject/project.properties new file mode 100644 index 0000000..c69d20d --- /dev/null +++ b/AdjustTime/nbproject/project.properties @@ -0,0 +1,94 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=AdjustTime +application.vendor=yuu +auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# \u914d\u7f6ejar\u304b\u3089\u9664\u5916\u3059\u308b\u5fc5\u8981\u304c\u3042\u308bbuild.classes.dir\u5185\u306e\u30d5\u30a1\u30a4\u30eb +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/AdjustTime.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.commons-imaging-1.0-SNAPSHOT.jar=../importPicture/commons-imaging-1.0-SNAPSHOT.jar +file.reference.importPicture-src=../importPicture/src +includes=** +jar.archive.disabled=${jnlp.enabled} +jar.compress=false +jar.index=${jnlp.enabled} +javac.classpath=\ + ${file.reference.commons-imaging-1.0-SNAPSHOT.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jnlp.codebase.type=no.codebase +jnlp.descriptor=application +jnlp.enabled=false +jnlp.mixed.code=default +jnlp.offline-allowed=false +jnlp.signed=false +jnlp.signing= +jnlp.signing.alias= +jnlp.signing.keystore= +main.class=osm.jp.gpx.matchtime.gui.AdjustTime +# \u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30b3\u30fc\u30c9\u30d9\u30fc\u30b9\u30fb\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u5c5e\u6027\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u306f\u3001RIA\u306e\u518d\u5229\u7528\u3092\u9632\u3050\u305f\u3081\u306b\u4f7f\u7528\u3057\u307e\u3059 +manifest.custom.codebase= +# \u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u6a29\u9650\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u5c5e\u6027\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9(\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u5024: sandbox\u3001all-permissions) +manifest.custom.permissions= +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.src.dir=${file.reference.importPicture-src} +test.src.dir=test diff --git a/AdjustTime/nbproject/project.xml b/AdjustTime/nbproject/project.xml new file mode 100644 index 0000000..5ec4c20 --- /dev/null +++ b/AdjustTime/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + AdjustTime + + + + + + + + + diff --git a/importPicture/src/README.jp.txt b/importPicture/src/README.jp.txt index c6f273e..fac8e3e 100644 --- a/importPicture/src/README.jp.txt +++ b/importPicture/src/README.jp.txt @@ -26,6 +26,18 @@ > java -jar importPicture.jar list.csv . IMG_01234.JPG 2012-06-15T12:52:22 鎌倉宮_2012-06-15_12-00-16.gpx + +[ GUIバージョン ] +撮影した画像を確認しながらパラメータを設定することができます。 +また、補正した撮影時刻と位置情報を画像ファイルのEXIFに書き込むことも可能です。 +EXIFへの書き込みには別途「Apache commons imaging」ライブラリが必要です。 +commons_imaging ライブラリは下記から入手してください。 +(version 1.0 以降が必要です) + +commons-imaging-1.0-SNAPSHOT.jarの入手元 + https://repository.apache.org/content/groups/snapshots/org/apache/commons/commons-imaging/1.0-SNAPSHOT/ + + ------------------------------------------------------------------- Copyright (c) 2014 Yuu Hayashi This software is released under the MIT License, see LICENSE.txt. \ No newline at end of file diff --git a/importPicture/src/osm/jp/gpx/ImportPicture.java b/importPicture/src/osm/jp/gpx/ImportPicture.java index 2615639..b14ad5b 100644 --- a/importPicture/src/osm/jp/gpx/ImportPicture.java +++ b/importPicture/src/osm/jp/gpx/ImportPicture.java @@ -244,11 +244,11 @@ System.out.println("GPX start time: "+ dfjp.format(new Date(gpxStartTime)) + "\t[GMT " + dfuk.format(new Date(gpxStartTime))+"]"); System.out.println(" GPX end time: "+ dfjp.format(new Date(gpxEndTime)) + "\t[GMT " + dfuk.format(new Date(gpxEndTime))+"]"); System.out.println(); - System.out.println("------------|--------------------|--------------------|------------|------------|--------"); - System.out.println(" name | UpdateTime | GPStime | Latitude | Longitude | ele"); - System.out.println("------------|--------------------|--------------------|------------|------------|--------"); + System.out.println("------------|--------------------|--------------------|------------|------------|--------|------|"); + System.out.println(" name | UpdateTime | GPStime | Latitude | Longitude | ele |magvar|"); + System.out.println("------------|--------------------|--------------------|------------|------------|--------|------|"); proc(gpxDir, delta, gpxStartTime, gpxEndTime, map, exif, gpx); - System.out.println("------------|--------------------|--------------------|------------|------------|--------"); + System.out.println("------------|--------------------|--------------------|------------|------------|--------|------|"); } catch (ParseException e) { System.out.println("'"+ timeStr +"' の書式が違います("+ TIME_FORMAT_STRING +")"); @@ -322,6 +322,7 @@ double longitude = Double.parseDouble(lonStr); String eleStr = null; + String magvarStr = null; NodeList nodes = wpt.getChildNodes(); // 子ノードを取得 for (int i4=0; i4< nodes.getLength(); i4++) { Node node = nodes.item(i4); @@ -331,7 +332,12 @@ System.out.println(String.format("%8s|", eleStr)); break; } - } + if (node.getNodeName().equals("magvar")) { + magvarStr = node.getFirstChild().getNodeValue(); + System.out.println(String.format("%6s|", magvarStr)); + break; + } + } else { System.out.println("-"); break; @@ -401,36 +407,36 @@ gpsDir.add(GpsTagConstants.GPS_TAG_GPS_LONGITUDE_REF, longitudeRef); gpsDir.removeField(GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF); gpsDir.add(GpsTagConstants.GPS_TAG_GPS_LATITUDE_REF, latitudeRef); - { - double value = longitude; - final double longitudeDegrees = (long) value; - value %= 1; - value *= 60.0; - final double longitudeMinutes = (long) value; - value %= 1; - value *= 60.0; - final double longitudeSeconds = value; - gpsDir.removeField(GpsTagConstants.GPS_TAG_GPS_LONGITUDE); - gpsDir.add(GpsTagConstants.GPS_TAG_GPS_LONGITUDE, - RationalNumber.valueOf(longitudeDegrees), - RationalNumber.valueOf(longitudeMinutes), - RationalNumber.valueOf(longitudeSeconds)); - } - { - double value = latitude; - final double latitudeDegrees = (long) value; - value %= 1; - value *= 60.0; - final double latitudeMinutes = (long) value; - value %= 1; - value *= 60.0; - final double latitudeSeconds = value; - gpsDir.removeField(GpsTagConstants.GPS_TAG_GPS_LATITUDE); - gpsDir.add(GpsTagConstants.GPS_TAG_GPS_LATITUDE, - RationalNumber.valueOf(latitudeDegrees), - RationalNumber.valueOf(latitudeMinutes), - RationalNumber.valueOf(latitudeSeconds)); - } + { + double value = longitude; + final double longitudeDegrees = (long) value; + value %= 1; + value *= 60.0; + final double longitudeMinutes = (long) value; + value %= 1; + value *= 60.0; + final double longitudeSeconds = value; + gpsDir.removeField(GpsTagConstants.GPS_TAG_GPS_LONGITUDE); + gpsDir.add(GpsTagConstants.GPS_TAG_GPS_LONGITUDE, + RationalNumber.valueOf(longitudeDegrees), + RationalNumber.valueOf(longitudeMinutes), + RationalNumber.valueOf(longitudeSeconds)); + } + { + double value = latitude; + final double latitudeDegrees = (long) value; + value %= 1; + value *= 60.0; + final double latitudeMinutes = (long) value; + value %= 1; + value *= 60.0; + final double latitudeSeconds = value; + gpsDir.removeField(GpsTagConstants.GPS_TAG_GPS_LATITUDE); + gpsDir.add(GpsTagConstants.GPS_TAG_GPS_LATITUDE, + RationalNumber.valueOf(latitudeDegrees), + RationalNumber.valueOf(latitudeMinutes), + RationalNumber.valueOf(latitudeSeconds)); + } ExifRewriter rewriter = new ExifRewriter(); try { @@ -513,27 +519,95 @@ } } + /** + * + * 47.20000076293945 + * + * + */ public static Element trkpt(HashMap map, Date jptime) throws ParseException { - long sa = 2L * 3600000L; - long jpt = jptime.getTime(); - Element ret = null; + Double R = 20000000 / Math.PI; // 地球の半径(m) + long sa = 2L * 3600000L; + long jpt = jptime.getTime(); + Element ret = null; + Element mae = null; - Set keySet = map.keySet(); //すべてのキー値を取得 - Iterator keyIte = keySet.iterator(); - while (keyIte.hasNext()) { //ループ。反復子iteratorによる キー 取得 - Long time = keyIte.next(); - long t = time.longValue(); - if (Math.abs(jpt - t) < sa) { - sa = Math.abs(jpt - t); - ret = map.get(time); - } - } + Set keySet = map.keySet(); //すべてのキー値を取得 + Iterator keyIte = keySet.iterator(); + while (keyIte.hasNext()) { //ループ。反復子iteratorによる キー 取得 + Long time = keyIte.next(); + long t = time; + if (Math.abs(jpt - t) < sa) { + sa = Math.abs(jpt - t); + ret = map.get(time); + + // がなければ、 + // 直前の位置と、現在地から進行方向を求める + NodeList nodes3 = ret.getChildNodes(); + Element magvar = null; + for (int i3=0; i3 < nodes3.getLength(); i3++) { + Node node4 = nodes3.item(i3); + if (node4.getNodeName().toLowerCase().equals("magvar")) { + magvar = (Element) node4; + break; + } + } + if (magvar == null) { + if (mae != null) { + Double maeLAT = null; + Double maeLON = null; + Double imaLAT = null; + Double imaLON =null; + + // 経度(longitude)と経度から進行方向を求める + NamedNodeMap nodeMap = mae.getAttributes(); + if (null != nodeMap) { + for (int j=0; j < nodeMap.getLength(); j++ ) { + switch (nodeMap.item(j).getNodeName()) { + case "lat": + String latStr = nodeMap.item(j).getNodeValue(); + maeLAT = new Double(latStr); + break; + case "lon": + String lonStr = nodeMap.item(j).getNodeValue(); + maeLON = new Double(lonStr); + break; + } + } + nodeMap = ret.getAttributes(); + for (int j=0; j < nodeMap.getLength(); j++ ) { + switch (nodeMap.item(j).getNodeName()) { + case "lat": + String latStr = nodeMap.item(j).getNodeValue(); + imaLAT = new Double(latStr); + break; + case "lon": + String lonStr = nodeMap.item(j).getNodeValue(); + imaLON = new Double(lonStr); + break; + } + } + Double dLON = imaLON - maeLON; + Double dLAT = imaLAT - maeLAT; + Double r = Math.cos(Math.toRadians((imaLAT + maeLAT) * 2)) * R; + Double x = Math.toRadians(imaLON - maeLON) * r; + Double y = Math.toRadians(imaLAT - maeLAT) * R; + Double rad = Math.tan(a).toDegrees(x / y); + magvar = ret.getOwnerDocument().createElement("magvar"); + magvar.setTextContent(rad.toString()); + ret.appendChild(magvar); + } + } + } + } + mae = map.get(time); + } - if (sa < (60000L * 10L)) { + if (sa < (60000L * 10L)) { // System.out.println(dfuk.format(jpt) +" ("+ sa +")"); return ret; - } - return null; + } + return null; } /** @@ -567,67 +641,81 @@ * @throws IOException */ public static Element createWptTag(File iFile, long timestamp, Element trkpt) { - Element wpt = document.createElement("wpt"); + Element wpt = document.createElement("wpt"); - NamedNodeMap nodeMap = trkpt.getAttributes(); - if (null != nodeMap) { - for (int j=0; j < nodeMap.getLength(); j++ ) { - if (nodeMap.item(j).getNodeName().equals("lat")) { - String lat = nodeMap.item(j).getNodeValue(); - wpt.setAttribute("lat", lat); - } - else if (nodeMap.item(j).getNodeName().equals("lon")) { - String lon = nodeMap.item(j).getNodeValue(); - wpt.setAttribute("lon", lon); - } - } - } + NamedNodeMap nodeMap = trkpt.getAttributes(); + if (null != nodeMap) { + for (int j=0; j < nodeMap.getLength(); j++ ) { + if (nodeMap.item(j).getNodeName().equals("lat")) { + String lat = nodeMap.item(j).getNodeValue(); + wpt.setAttribute("lat", lat); + } + else if (nodeMap.item(j).getNodeName().equals("lon")) { + String lon = nodeMap.item(j).getNodeValue(); + wpt.setAttribute("lon", lon); + } + } + } - NodeList nodes1 = trkpt.getChildNodes(); - for (int i1=0; i1 < nodes1.getLength(); i1++) { - Node node1 = nodes1.item(i1); - if (node1.getNodeName().equals("ele")) { - NodeList nodes2 = node1.getChildNodes(); - for (int i2=0; i2 < nodes2.getLength(); i2++) { - Node node2 = nodes2.item(i2); - if (node2 != null) { - if (node2.getNodeType() == Node.TEXT_NODE) { - String eleStr = node2.getNodeValue(); - Element eleE = document.createElement("ele"); - eleE.setTextContent(eleStr); - wpt.appendChild(eleE); - } - } - } - } - else if (node1.getNodeName().equals("time")) { - NodeList nodes2 = node1.getChildNodes(); - for (int i2=0; i2 < nodes2.getLength(); i2++) { - Node node2 = nodes2.item(i2); - if (node2 != null) { - if (node2.getNodeType() == Node.TEXT_NODE) { - String timeStr = node2.getNodeValue(); - Element timeE = document.createElement("time"); - timeE.setTextContent(timeStr); - wpt.appendChild(timeE); - } - } - } - } - } + NodeList nodes1 = trkpt.getChildNodes(); + for (int i1=0; i1 < nodes1.getLength(); i1++) { + Node node1 = nodes1.item(i1); + if (node1.getNodeName().equals("ele")) { + NodeList nodes2 = node1.getChildNodes(); + for (int i2=0; i2 < nodes2.getLength(); i2++) { + Node node2 = nodes2.item(i2); + if (node2 != null) { + if (node2.getNodeType() == Node.TEXT_NODE) { + String eleStr = node2.getNodeValue(); + Element eleE = document.createElement("ele"); + eleE.setTextContent(eleStr); + wpt.appendChild(eleE); + } + } + } + } + else if (node1.getNodeName().equals("time")) { + NodeList nodes2 = node1.getChildNodes(); + for (int i2=0; i2 < nodes2.getLength(); i2++) { + Node node2 = nodes2.item(i2); + if (node2 != null) { + if (node2.getNodeType() == Node.TEXT_NODE) { + String timeStr = node2.getNodeValue(); + Element timeE = document.createElement("time"); + timeE.setTextContent(timeStr); + wpt.appendChild(timeE); + } + } + } + } + else if (node1.getNodeName().equals("magvar")) { + NodeList nodes2 = node1.getChildNodes(); + for (int i2=0; i2 < nodes2.getLength(); i2++) { + Node node2 = nodes2.item(i2); + if (node2 != null) { + if (node2.getNodeType() == Node.TEXT_NODE) { + String magvarStr = node2.getNodeValue(); + Element magvarE = document.createElement("magvar"); + magvarE.setTextContent(magvarStr); + wpt.appendChild(magvarE); + } + } + } + } + } - Element name = document.createElement("name"); - name.appendChild(document.createCDATASection("写真")); - wpt.appendChild(name); + Element name = document.createElement("name"); + name.appendChild(document.createCDATASection("写真")); + wpt.appendChild(name); - Element link = document.createElement("link"); - link.setAttribute("href", getShortPathName(gpxDir, iFile)); - Element text = document.createElement("text"); - text.setTextContent(iFile.getName()); - link.appendChild(text); - wpt.appendChild(link); + Element link = document.createElement("link"); + link.setAttribute("href", getShortPathName(gpxDir, iFile)); + Element text = document.createElement("text"); + text.setTextContent(iFile.getName()); + link.appendChild(text); + wpt.appendChild(link); - return wpt; + return wpt; } static String getShortPathName(File dir, File iFile) {