• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Commit MetaInfo

Revisión9e0efb269876339af4ff399c4fa3b7018754583a (tree)
Tiempo2012-07-01 19:27:00
Autorunknown <yuu@c56n...>
Commiterunknown

Log Message

Merge branch 'master' of ssh://www.deister.jp/mnt/hdb1/git/ReadKIBAN

Cambiar Resumen

Diferencia incremental

--- a/src/hayashi/kiban/ConvAdmPt25000.java
+++ b/src/hayashi/kiban/ConvAdmPt25000.java
@@ -30,19 +30,19 @@ public class ConvAdmPt25000 {
3030 </lfSpanTo>
3131
3232 <devDate>
33- <jps:position>
34- <jps:date8601>2011-01-31</jps:date8601>
35- </jps:position>
33+ <jps:position>
34+ <jps:date8601>2011-01-31</jps:date8601>
35+ </jps:position>
3636 </devDate>
3737
3838 <orgGILvl>25000</orgGILvl>
3939 <vis>表示</vis>
4040
4141 <pos id="K6_2" uuid="fgoid:10-00150-11-1002-1530-g">
42- <jps:CRS uuidref="fguuid:jgd2000.bl"/>
43- <jps:position>
44- <jps:coordinate>37.055674 139.338021</jps:coordinate>
45- </jps:position>
42+ <jps:CRS uuidref="fguuid:jgd2000.bl"/>
43+ <jps:position>
44+ <jps:coordinate>37.055674 139.338021</jps:coordinate>
45+ </jps:position>
4646 </pos>
4747
4848 <type>その他</type>
--- a/src/hayashi/kiban/ConvBusstopGML.java
+++ b/src/hayashi/kiban/ConvBusstopGML.java
@@ -39,7 +39,8 @@ public class ConvBusstopGML {
3939 * @throws FileNotFoundException
4040 * @throws TransformerException
4141 * @throws SAXException
42- * @throws ParserConfigurationException */
42+ * @throws ParserConfigurationException
43+ */
4344 public static void main(String[] args) throws FileNotFoundException, ClassNotFoundException, SQLException, IOException, ParserConfigurationException, SAXException, TransformerException
4445 {
4546 int index = 0;
@@ -61,39 +62,35 @@ public class ConvBusstopGML {
6162 /**
6263 * バス停データ変換のメイン処理
6364 */
65+ if (updateDb) {
66+ File dbdir = new File("database");
67+ if (dbdir.isDirectory()) {
68+ dbdir.delete();
69+ }
70+ dbdir.mkdir();
71+ }
6472
6573 int fcounter = 0;
6674 if (args.length > index) {
75+ ConvBusstopGML.initDb(con);
6776 File iFile = new File(args[index]);
6877 fcounter++;
6978
70- ConvBusstopGML.initDb(con);
7179 inputFile(con, iFile);
7280 String iStr = iFile.getName();
7381 outputDb(con, iStr.substring(0, iStr.length() - 4));
7482 }
7583 else {
76- if (updateDb) {
77- File dbdir = new File("database");
78- if (dbdir.isDirectory()) {
79- dbdir.delete();
80- }
81- dbdir.mkdir();
82- }
83-
8484 File dir = new File(".");
8585 File[] files = dir.listFiles();
8686
8787 for (File iFile : files) {
88- ConvBusstopGML.initDb(con);
8988 if (checkFile(iFile)) {
89+ ConvBusstopGML.initDb(con);
9090 fcounter++;
9191 inputFile(con, iFile);
92- }
93- }
94- // ローカルデータベース内の情報を出力する
95- for (File iFile : files) {
96- if (checkFile(iFile)) {
92+
93+ // ローカルデータベース内の情報を出力する
9794 String iStr = iFile.getName();
9895 outputDb(con, iStr.substring(0, iStr.length() - 4));
9996 }
@@ -302,57 +299,58 @@ public class ConvBusstopGML {
302299 ResultSet rset9 = ps9.executeQuery();
303300 while (rset9.next()) {
304301 String idref = rset9.getString(1);
302+ if ((idref != null) && (!idref.equals(""))) {
303+ ps8.setString(1, idref);
304+ ResultSet rset8 = ps8.executeQuery();
305+ if (rset8.next()) {
306+ stopCount++;
307+ String name = rset8.getString(1);
308+ Double lat = rset8.getDouble(2);
309+ Double lon = rset8.getDouble(3);
310+ int fixed = rset8.getInt(4);
311+
312+ if (lat > maxLat) {
313+ maxLat = lat;
314+ }
315+ if (lon > maxLon) {
316+ maxLon = lon;
317+ }
318+ if (lat < minLat) {
319+ minLat = lat;
320+ }
321+ if (lon < minLon) {
322+ minLon = lon;
323+ }
305324
306- ps8.setString(1, idref);
307- ResultSet rset8 = ps8.executeQuery();
308- if (rset8.next()) {
309- stopCount++;
310- String name = rset8.getString(1);
311- Double lat = rset8.getDouble(2);
312- Double lon = rset8.getDouble(3);
313- int fixed = rset8.getInt(4);
314-
315- if (lat > maxLat) {
316- maxLat = lat;
317- }
318- if (lon > maxLon) {
319- maxLon = lon;
320- }
321- if (lat < minLat) {
322- minLat = lat;
323- }
324- if (lon < minLon) {
325- minLon = lon;
326- }
327-
328- System.out.println("\tway point = "+ idref);
329- fixedCount += fixed;
330- if (fixed == 0) {
331- unfixedCount++;
332-
333- // OSM node
334- int nodeid = Integer.parseInt(idref.substring(1)) * -1;
335- String osm_node = nodeBusstop(nodeid, name, lat, lon, timeStampStr);
336- ow.write(osm_node);
337- ow.newLine();
338-
339- // TEXT node
340- File txtFile = new File(dir, iCode + idref +".txt");
341- BufferedWriter gw2 = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(txtFile), "UTF-8"));
342- gw2.write(osm_node);
343- gw2.newLine();
344- gw2.close();
345-
346- // GPX waypoint
347- gw.write("<wpt lat=\""+ lat +"\" lon=\""+ lon +"\">\n");
348- gw.write(" <time>"+ timeStampStr +"Z</time>\n");
349- gw.write(" <name><![CDATA["+ name +"]]></name>\n");
350- gw.write(" <link href=\""+ txtFile.getName() +"\"><text>"+ idref +"</text></link>\n");
351- gw.write("</wpt>\n");
352- gw.newLine();
325+ System.out.println("\tway point = "+ idref);
326+ fixedCount += fixed;
327+ if (fixed == 0) {
328+ unfixedCount++;
329+
330+ // OSM node
331+ int nodeid = Integer.parseInt(idref.substring(1)) * -1;
332+ String osm_node = nodeBusstop(nodeid, name, lat, lon, timeStampStr);
333+ ow.write(osm_node);
334+ ow.newLine();
335+
336+ // TEXT node
337+ File txtFile = new File(dir, iCode + idref +".txt");
338+ BufferedWriter gw2 = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(txtFile), "UTF-8"));
339+ gw2.write(osm_node);
340+ gw2.newLine();
341+ gw2.close();
342+
343+ // GPX waypoint
344+ gw.write("<wpt lat=\""+ lat +"\" lon=\""+ lon +"\">\n");
345+ gw.write(" <time>"+ timeStampStr +"Z</time>\n");
346+ gw.write(" <name><![CDATA["+ name +"]]></name>\n");
347+ gw.write(" <link href=\""+ txtFile.getName() +"\"><text>"+ idref +"</text></link>\n");
348+ gw.write("</wpt>\n");
349+ gw.newLine();
350+ }
353351 }
352+ rset8.close();
354353 }
355- rset8.close();
356354 }
357355 rset9.close();
358356
@@ -611,15 +609,16 @@ public class ConvBusstopGML {
611609 */
612610 public static String[] anaComm(Node briNode) {
613611 String[] rtn = new String[3];
614- rtn[0] = ""; // corp type
612+ rtn[0] = "0"; // corp type
615613 rtn[1] = ""; // course name
616614 rtn[2] = ""; // corp name
617615
616+ // Node briNode = <ksj:busRouteInformation>
618617 NodeList nodes = briNode.getChildNodes();
619618 for (int i=0; i < nodes.getLength(); i++) {
620619 Node node2 = nodes.item(i);
621620
622- if (node2.getNodeName().equals("ksj:busRouteInformation")) {
621+ if (node2.getNodeName().equals("ksj:BusRouteInformation")) {
623622 NodeList nodes2 = node2.getChildNodes();
624623 for (int i2=0; i2 < nodes2.getLength(); i2++) {
625624 Node node3 = nodes2.item(i2);
@@ -634,10 +633,11 @@ public class ConvBusstopGML {
634633 rtn[2] = node3.getTextContent();
635634 }
636635 }
636+ return rtn;
637637 }
638638
639639 }
640- return rtn;
640+ return null;
641641 }
642642
643643 /**