OSDN Git Service

GML形式においてコース分けが表示されない不具合を修正
authorhayashi <hayashi.yuu@gmail.com>
Wed, 12 Dec 2012 07:20:42 +0000 (16:20 +0900)
committerhayashi <hayashi.yuu@gmail.com>
Wed, 12 Dec 2012 07:20:42 +0000 (16:20 +0900)
ConvBusstop.zip [new file with mode: 0644]
src/osm/jp/ConvBusstop.java

diff --git a/ConvBusstop.zip b/ConvBusstop.zip
new file mode 100644 (file)
index 0000000..8a55d6c
Binary files /dev/null and b/ConvBusstop.zip differ
index 1f08e5a..b66c1ce 100644 (file)
@@ -570,6 +570,31 @@ public class ConvBusstop {
        }
 
        /**
+        * <ksj:BusStop gml:id="ED01_1">
+        *      <ksj:position xlink:href="#n1"/>
+        *      <ksj:busStopName>城堀</ksj:busStopName>
+        *      <ksj:busRouteInformation>
+        *              <ksj:BusRouteInformation>
+        *                      <ksj:busType>1</ksj:busType>
+        *                      <ksj:busOperationCompany>箱根登山バス</ksj:busOperationCompany>
+        *                      <ksj:busLineName>小01</ksj:busLineName>
+        *              </ksj:BusRouteInformation>
+        *      </ksj:busRouteInformation>
+        *      <ksj:busRouteInformation>
+        *              <ksj:BusRouteInformation>
+        *                      <ksj:busType>1</ksj:busType>
+        *                      <ksj:busOperationCompany>箱根登山バス</ksj:busOperationCompany>
+        *                      <ksj:busLineName>湯07</ksj:busLineName>
+        *              </ksj:BusRouteInformation>
+        *      </ksj:busRouteInformation>
+        *      <ksj:busRouteInformation>
+        *              <ksj:BusRouteInformation>
+        *                      <ksj:busType>1</ksj:busType>
+        *                      <ksj:busOperationCompany>箱根登山バス</ksj:busOperationCompany>
+        *                      <ksj:busLineName>湯11</ksj:busLineName>
+        *              </ksj:BusRouteInformation>
+        *      </ksj:busRouteInformation>
+        * </ksj:BusStop>
         *
         * @param con
         * @param node
@@ -651,7 +676,7 @@ public class ConvBusstop {
                                rset6.close();
                                code++;
 
-                               System.out.println("code="+code);
+                               System.out.println("course="+ code +" : "+ rtn[0] +" : "+ rtn[1] +" : "+ rtn[2] );
                                ps4.setInt(1, code);
                                ps4.setInt(2, Integer.parseInt(rtn[0]));
                                ps4.setString(3, rtn[2]);
@@ -694,33 +719,50 @@ public class ConvBusstop {
                return rtn;
        }
 
+       /**
+        *
+        *      <ksj:busRouteInformation>
+        *              <ksj:BusRouteInformation>
+        *                      <ksj:busType>1</ksj:busType>
+        *                      <ksj:busOperationCompany>箱根登山バス</ksj:busOperationCompany>
+        *                      <ksj:busLineName>小01</ksj:busLineName>
+        *              </ksj:BusRouteInformation>
+        *      </ksj:busRouteInformation>
+        *
+        * @param briNode
+        * @return
+        */
        public static String[] anaCommJGD(Node briNode) {
                String[] rtn = new String[3];
-               rtn[0] = "";    // corp type
-               rtn[1] = "";    // course name
-               rtn[2] = "";    // corp name
+               int vcnt = 0;
 
-               NodeList nodes = briNode.getChildNodes();
-               for (int i=0; i < nodes.getLength(); i++) {
-                       Node node2 = nodes.item(i);
+               NodeList nodes2 = briNode.getChildNodes();
+               for (int i=0; i < nodes2.getLength(); i++) {
+                       Node node2 = nodes2.item(i);
                        if (node2.getNodeName().equals("ksj:BusRouteInformation")) {
                                NodeList nodes3 = node2.getChildNodes();
                                for (int j=0; j < nodes3.getLength(); j++) {
-                                       Node node = nodes3.item(j);
-                                       if (node.getNodeName().equals("ksj:busType")) {
-                                               rtn[0] = node.getTextContent();
+                                       Node node3 = nodes3.item(j);
+                                       if (node3.getNodeName().equals("ksj:busType")) {
+                                               rtn[0] = new String(node3.getTextContent());
+                                               vcnt++;
                                        }
-                                       else if (node2.getNodeName().equals("ksj:busLineName")) {
-                                               rtn[1] = node.getTextContent();
+                                       else if (node3.getNodeName().equals("ksj:busLineName")) {
+                                               rtn[1] = new String(node3.getTextContent());
+                                               vcnt++;
                                        }
-                                       else if (node.getNodeName().equals("ksj:busOperationCompany")) {
-                                               rtn[2] = node.getTextContent();
+                                       else if (node3.getNodeName().equals("ksj:busOperationCompany")) {
+                                               rtn[2] = new String(node3.getTextContent());
+                                               vcnt++;
                                        }
                                }
                        }
                }
 
-               return rtn;
+               if (vcnt > 0) {
+                       return rtn;
+               }
+               return null;
        }
 
        public static void showGmPoint(Connection con, Node node) throws IOException, SQLException {