コード例 #1
0
 public static String AreaOverlapPref(
     LonLat point, ArrayList<String> JIScodes) { // JIScodes = 08,...
   List<String> zonecodeList = gchecker.listOverlaps("JCODE", point.getLon(), point.getLat());
   //		System.out.println("point: " + point + ", zonecodelist: " + zonecodeList);
   if (zonecodeList == null || zonecodeList.isEmpty()) { // zonecodelist.get(0) = 8988, ...
     return "null";
   } else if (zonecodeList.get(0).length() > 0) {
     if (Integer.valueOf(zonecodeList.get(0)) >= 10000) {
       String code = zonecodeList.get(0).substring(0, 2);
       if (JIScodes.contains(code)) {
         return code;
       } else {
         return "null";
       }
     } else if (Integer.valueOf(zonecodeList.get(0)) < 9999) {
       String code = String.format("%02d", Integer.valueOf(zonecodeList.get(0).substring(0, 1)));
       if (JIScodes.contains(code)) {
         return code;
       } else {
         return "null";
       }
     } else {
       return "null";
     }
   } else {
     return "null";
   }
 }
コード例 #2
0
 public static String AreaOverlap(LonLat point, ArrayList<String> JIScodes) {
   List<String> zonecodeList = gchecker.listOverlaps("JCODE", point.getLon(), point.getLat());
   if (zonecodeList == null || zonecodeList.isEmpty()) {
     return "null";
   } else if (JIScodes.contains(zonecodeList.get(0))) {
     return zonecodeList.get(0);
   } else {
     return "null";
   }
 }