예제 #1
0
 /**
  * @param dataStore
  * @param damageArea
  * @return
  * @throws SQLException
  * @throws IOException
  * @throws ParseException
  */
 private Geometry loadDamageArea(JDBCDataStore dataStore, String damageArea)
     throws IOException, SQLException, ParseException {
   if (damageArea.matches("^[0-9]+$")) {
     int id = Integer.parseInt(damageArea);
     damageArea = ProcessingRepository.loadData(dataStore, -1, id);
   }
   return wktReader.read(damageArea);
 }
예제 #2
0
 /**
  * @param simulationTargets
  * @param changedTargets
  * @throws ParseException
  * @throws SQLException
  * @throws IOException
  */
 public static void loadSimulationTargets(
     JDBCDataStore dataStore, List<TargetInfo> valuesMap, String valuesList)
     throws ParseException, IOException, SQLException {
   if (valuesList.matches("^[0-9]+$")) {
     int id = Integer.parseInt(valuesList);
     valuesList = ProcessingRepository.loadData(dataStore, -1, id);
   }
   for (String record : valuesList.split("_")) {
     String[] parts = record.split(",");
     int id = Integer.parseInt(parts[0]);
     double value = Double.parseDouble(parts[1]);
     String geometry = parts[2];
     for (int count = 3; count < parts.length; count++) {
       geometry += "," + parts[count];
     }
     if (geometry != null && !geometry.equals("")) {
       valuesMap.add(new TargetInfo(id, wktReader.read(geometry), value));
     }
   }
 }