public AbstractFeature createFeature(FeatureEntity f) throws OwsExceptionReport { final CodeWithAuthority identifier = getIdentifier(f); if (!SosHelper.checkFeatureOfInterestIdentifierForSosV2(f.getIdentifier(), getContext().getVersion())) { identifier.setValue(null); } final AbstractFeature absFeat = getFeatureType(identifier); addNameAndDescription(getContext().getRequestedLanguage(), f, absFeat); if (absFeat instanceof AbstractSamplingFeature) { AbstractSamplingFeature absSampFeat = (AbstractSamplingFeature) absFeat; absSampFeat.setGeometry(createGeometryFrom(f)); absSampFeat.setFeatureType(f.getFeatureType().getFormat()); absSampFeat.setUrl(f.getUrl()); if (f.isSetXml()) { absSampFeat.setXml(f.getXml()); } addParameter(absSampFeat, f); final Set<FeatureEntity> parentFeatures = f.getParents(); if (parentFeatures != null && !parentFeatures.isEmpty()) { final List<AbstractFeature> sampledFeatures = new ArrayList<AbstractFeature>(parentFeatures.size()); for (final AbstractFeatureEntity parentFeature : parentFeatures) { sampledFeatures.add(new HibernateFeatureVisitor(getContext()).visit(parentFeature)); } absSampFeat.setSampledFeatures(sampledFeatures); } } return absFeat; }
public AbstractFeature createFeature(FeatureEntity f) throws OwsExceptionReport { final CodeWithAuthority identifier = getIdentifier(f); if (!SosHelper.checkFeatureOfInterestIdentifierForSosV2(f.getIdentifier(), getContext().getVersion())) { identifier.setValue(null); } final AbstractFeature absFeat = getFeatureType(identifier); addNameAndDescription(getContext().getRequestedLanguage(), f, absFeat); if (absFeat instanceof AbstractSamplingFeature) { AbstractSamplingFeature absSampFeat = (AbstractSamplingFeature) absFeat; absSampFeat.setGeometry(createGeometryFrom(f)); absSampFeat.setFeatureType(f.getFeatureType().getFormat()); absSampFeat.setUrl(f.getUrl()); if (f.isSetXml()) { absSampFeat.setXml(f.getXml()); } addParameter(absSampFeat, f); final Set<FeatureEntity> parentFeatures = f.getParents(); if (parentFeatures != null && !parentFeatures.isEmpty()) { final List<AbstractFeature> sampledFeatures = new ArrayList<AbstractFeature>(parentFeatures.size()); for (final AbstractFeatureEntity parentFeature : parentFeatures) { sampledFeatures.add(new HibernateFeatureVisitor(getContext()).visit(parentFeature)); } absSampFeat.setSampledFeatures(sampledFeatures); } } return absFeat; }