示例#1
0
 private List<SamplingFeature> getAllFeaturesFrom(FeatureCollection featureCollection) {
   List<SamplingFeature> features =
       new ArrayList<SamplingFeature>(featureCollection.getMembers().size());
   for (AbstractFeature abstractFeature : featureCollection.getMembers().values()) {
     if (abstractFeature instanceof SamplingFeature) {
       features.add((SamplingFeature) abstractFeature);
     } else if (abstractFeature instanceof FeatureCollection) {
       features.addAll(getAllFeaturesFrom((FeatureCollection) abstractFeature));
     }
   }
   return features;
 }
示例#2
0
文件: AqdHelper.java 项目: ridoo/SOS
 public void processObservation(
     OmObservation observation,
     TimePeriod timePeriod,
     TimeInstant resultTime,
     FeatureCollection featureCollection,
     AbstractEReportingHeader eReportingHeader,
     int counter) {
   if (observation.isSetPhenomenonTime()) {
     // generate gml:id
     observation.setGmlId(getObservationId(counter));
     // add xlink:href to eReportingHeader.content
     eReportingHeader.addContent(
         (AbstractFeature)
             new OmObservation()
                 .setIdentifier(
                     new CodeWithAuthority(getObservationXlink(observation.getGmlId()))));
     timePeriod.extendToContain(observation.getPhenomenonTime());
     observation.setResultTime(resultTime);
     featureCollection.addMember(observation);
   }
 }