public String mergeAggregateResults2FeatureSet(String featureSet, AnalysisLayer analysisLayer) {
   try {
     // Add aggregate results to FeatureCollection ( only to one feature)
     featureSet =
         transformationService.addPropertiesTo1stFeature(featureSet, analysisLayer.getResult());
   } catch (ServiceException e) {
     log.debug("Feature property insert to FeatureCollection failed: ", e);
   }
   return featureSet;
 }
  public AnalysisLayer parseSwitch2UnionLayer(
      AnalysisLayer analysisLayer, String layerJSON, String filter, String baseUrl)
      throws ServiceException {
    // Switch to UNION method
    layerJSON = layerJSON.replace("\"method\":\"aggregate\"", "\"method\":\"union\"");

    AnalysisLayer al2 = this.parseAnalysisLayer(layerJSON, filter, baseUrl);
    al2.setResult(analysisLayer.getResult());
    return al2;
  }