/*
   * Returns list of sensors currently loaded in the system
   * */
  public static String getListOfSensors() {
    StringBuilder s = new StringBuilder();
    Iterator iter = Mappings.getAllVSensorConfigs();
    while (iter.hasNext()) {
      VSensorConfig sensorConfig = (VSensorConfig) iter.next();
      Double longitude = sensorConfig.getLongitude();
      Double latitude = sensorConfig.getLatitude();
      String sensor = sensorConfig.getName();

      if ((latitude != null) && (longitude != null)) {
        Point point =
            geometryFactory.createPoint(
                new Coordinate(longitude.doubleValue(), latitude.doubleValue()));
        coordinates.add(point);
        sensors.add(sensor);
        s.append(sensor)
            .append(" => ")
            .append(longitude)
            .append(" : ")
            .append(latitude)
            .append(NEWLINE);
      }
    }
    return s.toString();
  }
Example #2
0
 /**
  * Case insensitive matching.
  *
  * @param vsName
  * @return
  */
 public static VSensorConfig getConfig(String vsName) {
   Iterator<VSensorConfig> configs = Mappings.getAllVSensorConfigs();
   while (configs.hasNext()) {
     VSensorConfig config = configs.next();
     if (config.getName().equalsIgnoreCase(vsName)) return config;
   }
   return null;
 }