use of org.apache.sis.metadata.iso.quality.DefaultQuantitativeResult in project sis by apache.
the class CustomAttribute method quality.
/**
* Evaluates the quality of this attribute with a custom rule.
*/
@Override
public DataQuality quality() {
final DefaultDataQuality quality = (DefaultDataQuality) super.quality();
final DefaultDomainConsistency report = new DefaultDomainConsistency();
final DefaultQuantitativeResult result = new DefaultQuantitativeResult();
result.setErrorStatistic(new SimpleInternationalString(ADDITIONAL_QUALITY_INFO));
report.setMeasureIdentification(new NamedIdentifier(getName()));
report.setResults(singleton(result));
quality.setReports(singleton(report));
return quality;
}
use of org.apache.sis.metadata.iso.quality.DefaultQuantitativeResult in project sis by apache.
the class TransformationAccuracy method create.
/**
* Creates a positional accuracy for the given value, in metres.
* This method may return a cached value.
*
* @param accuracy the accuracy in metres.
* @return a positional accuracy with the given value.
*/
public static PositionalAccuracy create(final Double accuracy) {
PositionalAccuracy p = CACHE.get(accuracy);
if (p == null) {
final DefaultRecord record = new DefaultRecord(TYPE);
record.setAll(accuracy);
final DefaultQuantitativeResult result = new DefaultQuantitativeResult();
result.setValues(Collections.singletonList(record));
// In metres by definition in the EPSG database.
result.setValueUnit(Units.METRE);
result.setValueType(TYPE);
final DefaultAbsoluteExternalPositionalAccuracy element = new DefaultAbsoluteExternalPositionalAccuracy(result);
element.setNamesOfMeasure(Collections.singleton(TRANSFORMATION_ACCURACY));
element.setEvaluationMethodType(EvaluationMethodType.DIRECT_EXTERNAL);
element.freeze();
p = CACHE.putIfAbsent(accuracy, element);
if (p == null) {
p = element;
}
}
return p;
}
Aggregations