Exemplo n.º 1
0
 private ReferenceType getFeatureOfInterestReferenceType(
     Object featureOfInterest, Map<String, ReferenceType> featuresOfInterest)
     throws OwsExceptionReport {
   String identifier = null;
   if (featureOfInterest instanceof FeatureOfInterest) {
     identifier = ((FeatureOfInterest) featureOfInterest).getIdentifier();
   } else if (featureOfInterest instanceof String) {
     identifier = (String) featureOfInterest;
   } else {
     throw new NoApplicableCodeException()
         .withMessage(
             "GetDataAvailability procedure query object type {} is not supported!",
             featureOfInterest.getClass().getName());
   }
   if (!featuresOfInterest.containsKey(identifier)) {
     ReferenceType referenceType = new ReferenceType(identifier);
     FeatureQueryHandlerQueryObject queryObject =
         new FeatureQueryHandlerQueryObject()
             .addFeatureIdentifier(identifier)
             .setConnection(session)
             .setVersion(Sos2Constants.SERVICEVERSION);
     AbstractFeature feature =
         Configurator.getInstance().getFeatureQueryHandler().getFeatureByID(queryObject);
     if (feature.isSetName() && feature.getFirstName().isSetValue()) {
       referenceType.setTitle(feature.getFirstName().getValue());
     }
     featuresOfInterest.put(identifier, referenceType);
   }
   return featuresOfInterest.get(identifier);
 }
Exemplo n.º 2
0
 private ReferenceType getFeatureOfInterestReference(
     Series series, Map<String, ReferenceType> featuresOfInterest, Session session)
     throws OwsExceptionReport {
   String identifier = series.getFeatureOfInterest().getIdentifier();
   if (!featuresOfInterest.containsKey(identifier)) {
     ReferenceType referenceType = new ReferenceType(identifier);
     FeatureQueryHandlerQueryObject queryObject = new FeatureQueryHandlerQueryObject();
     queryObject
         .addFeatureIdentifier(identifier)
         .setConnection(session)
         .setVersion(Sos2Constants.SERVICEVERSION);
     AbstractFeature feature =
         Configurator.getInstance().getFeatureQueryHandler().getFeatureByID(queryObject);
     if (feature.isSetName() && feature.getFirstName().isSetValue()) {
       referenceType.setTitle(feature.getFirstName().getValue());
     }
     featuresOfInterest.put(identifier, referenceType);
   }
   return featuresOfInterest.get(identifier);
 }