/** * Returns {@code true} if the responsible party described by the given keys is an organization. * In case of doubt, this method returns {@code false}. This is consistent with ACDD recommendation, * which set the default value to {@code "person"}. */ private boolean isOrganisation(final Responsible keys) { final String type = stringValue(keys.TYPE); return "institution".equalsIgnoreCase(type) || "group".equalsIgnoreCase(type); }
/** * Returns {@code true} if the responsible party described by the given keys is an organization. * In case of doubt, this method returns {@code false}. This is consistent with ACDD recommendation, * which set the default value to {@code "person"}. */ private boolean isOrganisation(final Responsible keys) { final String type = stringValue(keys.TYPE); return "institution".equalsIgnoreCase(type) || "group".equalsIgnoreCase(type); }
/** * Adds information about acquisition (program, platform). */ private void addAcquisitionInfo() { final Term[] attributes = { AttributeNames.PROGRAM, AttributeNames.PLATFORM, AttributeNames.INSTRUMENT }; for (int i=0; i<attributes.length; i++) { final Term at = attributes[i]; final String authority = stringValue(at.VOCABULARY); for (final String keyword : split(stringValue(at.TEXT))) { switch (i) { case 0: { if (EXPERIMENTAL) { addAcquisitionOperation(authority, keyword); } break; } case 1: addPlatform (authority, keyword); break; case 2: addInstrument(authority, keyword); break; } } } }
/** * Adds information about acquisition (program, platform). */ private void addAcquisitionInfo() { final Term[] attributes = { AttributeNames.PROGRAM, AttributeNames.PLATFORM, AttributeNames.INSTRUMENT }; for (int i=0; i<attributes.length; i++) { final Term at = attributes[i]; final String authority = stringValue(at.VOCABULARY); for (final String keyword : split(stringValue(at.TEXT))) { switch (i) { case 0: { if (EXPERIMENTAL) { addAcquisitionOperation(authority, keyword); } break; } case 1: addPlatform (authority, keyword); break; case 2: addInstrument(authority, keyword); break; } } } }
for (final String path : searchPath) { decoder.setSearchPath(path); keywords.addAll(split(stringValue(KEYWORDS.TEXT))); standard = addIfNonNull(standard, stringValue(STANDARD_NAME.TEXT)); project = addIfNonNull(project, stringValue(PROJECT)); for (final String keyword : split(stringValue(ACCESS_CONSTRAINT))) { addAccessConstraint(forCodeName(Restriction.class, keyword)); addTopicCategory(forCodeName(TopicCategory.class, stringValue(TOPIC_CATEGORY))); addSpatialRepresentation(forCodeName(SpatialRepresentationType.class, stringValue(DATA_TYPE))); if (!hasExtent) { addAbstract (stringValue(SUMMARY)); addPurpose (stringValue(PURPOSE)); addSupplementalInformation(stringValue(COMMENT)); addCredits (stringValue(ACKNOWLEDGEMENT)); addCredits (stringValue("acknowledgment")); // Legacy spelling. addUseLimitation (stringValue(LICENSE)); addKeywords(standard, KeywordType.THEME, stringValue(STANDARD_NAME.VOCABULARY)); addKeywords(keywords, KeywordType.THEME, stringValue(KEYWORDS.VOCABULARY)); addKeywords(project, KeywordType.valueOf("PROJECT"), null); addKeywords(publisher, KeywordType.valueOf("DATA_CENTRE"), null); final String wkt = stringValue(GEOSPATIAL_BOUNDS); if (wkt != null) { addBoundingPolygon(new StoreFormat(decoder.geomlib, decoder.listeners).parseGeometry(wkt, stringValue(GEOSPATIAL_BOUNDS + "_crs"), stringValue(GEOSPATIAL_BOUNDS + "_vertical_crs")));
String identifier = stringValue(IDENTIFIER.TEXT); String authority; if (identifier != null) { authority = stringValue(IDENTIFIER.VOCABULARY); } else { identifier = decoder.getId();
String identifier = stringValue(IDENTIFIER.TEXT); String authority; if (identifier != null) { authority = stringValue(IDENTIFIER.VOCABULARY); } else { identifier = decoder.getId();
for (final String path : searchPath) { decoder.setSearchPath(path); keywords.addAll(split(stringValue(KEYWORDS.TEXT))); standard = addIfNonNull(standard, stringValue(STANDARD_NAME.TEXT)); project = addIfNonNull(project, stringValue(PROJECT)); for (final String keyword : split(stringValue(ACCESS_CONSTRAINT))) { addAccessConstraint(forCodeName(Restriction.class, keyword)); addTopicCategory(forCodeName(TopicCategory.class, stringValue(TOPIC_CATEGORY))); SpatialRepresentationType dt = forCodeName(SpatialRepresentationType.class, stringValue(DATA_TYPE)); addSpatialRepresentation(dt); hasDataType |= (dt != null); addAbstract (stringValue(SUMMARY)); addPurpose (stringValue(PURPOSE)); addSupplementalInformation(stringValue(COMMENT)); addCredits (stringValue(ACKNOWLEDGEMENT)); addCredits (stringValue("acknowledgment")); // Legacy spelling. addUseLimitation (stringValue(LICENSE)); addKeywords(standard, KeywordType.THEME, stringValue(STANDARD_NAME.VOCABULARY)); addKeywords(keywords, KeywordType.THEME, stringValue(KEYWORDS.VOCABULARY)); addKeywords(project, KeywordType.valueOf("PROJECT"), null); addKeywords(publisher, KeywordType.valueOf("DATA_CENTRE"), null); final String wkt = stringValue(GEOSPATIAL_BOUNDS); if (wkt != null) { addBoundingPolygon(new StoreFormat(decoder.geomlib, decoder.listeners).parseGeometry(wkt, stringValue(GEOSPATIAL_BOUNDS + "_crs"), stringValue(GEOSPATIAL_BOUNDS + "_vertical_crs")));
final String res = stringValue(attributeNames.RESOLUTION); if (res != null) try {
boolean hasExtent = !Double.isNaN(min) || !Double.isNaN(max); if (hasExtent) { final String symbol = stringValue(dim.UNITS); if (symbol != null) { try { } else if (dim.POSITIVE != null) { reverse = CF.POSITIVE_DOWN.equals(stringValue(dim.POSITIVE));
final String processingLevel = stringValue(PROCESSING_LEVEL); for (final List<Variable> group : contents.values()) {
final String processingLevel = stringValue(PROCESSING_LEVEL); for (final List<Variable> group : contents.values()) {
String title = stringValue(TITLE); if (title == null) { title = stringValue("full_name"); // THREDDS attribute documented in TITLE javadoc. if (title == null) { title = stringValue("name"); // THREDDS attribute documented in TITLE javadoc. if (title == null) { title = decoder.getTitle(); addEdition(stringValue(PRODUCT_VERSION)); addOtherCitationDetails(stringValue(REFERENCES)); addCitationDate(decoder.dateValue(METADATA_CREATION), DateType.CREATION, Scope.ALL); addCitationDate(decoder.dateValue(METADATA_MODIFIED), DateType.REVISION, Scope.ALL);
addIdentificationInfo(addCitation()); for (final String service : SERVICES) { final String name = stringValue(service); if (name != null) { addResourceScope(ScopeCode.SERVICE, name); addLineage(stringValue(HISTORY)); addSource(stringValue(SOURCE), null, null); addCompleteMetadata(createURI(stringValue(METADATA_LINK))); metadata.transition(DefaultMetadata.State.FINAL); return metadata;
addExtent(stringValue(GEOGRAPHIC_IDENTIFIER)); final double[] extent = new double[4]; final Number tmax = decoder.numericValue(TIME.MAXIMUM); if (tmin != null || tmax != null) { final String symbol = stringValue(TIME.UNITS); if (symbol != null) { final Date[] dates = decoder.numberToDate(symbol, tmin, tmax);
String title = stringValue(TITLE); if (title == null) { title = stringValue("full_name"); // THREDDS attribute documented in TITLE javadoc. if (title == null) { title = stringValue("name"); // THREDDS attribute documented in TITLE javadoc. if (title == null) { title = decoder.getTitle(); addEdition(stringValue(PRODUCT_VERSION)); addOtherCitationDetails(stringValue(REFERENCES)); addCitationDate(decoder.dateValue(METADATA_CREATION), DateType.CREATION, Scope.ALL); addCitationDate(decoder.dateValue(METADATA_MODIFIED), DateType.REVISION, Scope.ALL);
/** * Adds metadata about a sample dimension (or band) from the given variable. * This is the {@code <mrc:dimension>} element in XML. * * @param variable the netCDF variable. */ private void addSampleDimension(final Variable variable) { newSampleDimension(); final String name = trim(variable.getName()); if (name != null) { final DefaultNameFactory f = decoder.nameFactory; setBandIdentifier(f.createMemberName(null, name, f.createTypeName(null, variable.getDataTypeName()))); } final String id = trim(variable.getAttributeAsString(CF.STANDARD_NAME)); if (id != null && !id.equals(name)) { addBandName(variable.getAttributeAsString(ACDD.standard_name_vocabulary), id); } final String description = trim(variable.getDescription()); if (description != null && !description.equals(name) && !description.equals(id)) { addBandDescription(description); } setSampleUnits(variable.getUnit()); setTransferFunction(variable.getAttributeAsNumber(CDM.SCALE_FACTOR), variable.getAttributeAsNumber(CDM.ADD_OFFSET)); addContentType(forCodeName(CoverageContentType.class, stringValue(ACDD.coverage_content_type))); }
addIdentificationInfo(publisher); for (final String service : SERVICES) { final String name = stringValue(service); if (name != null) { addResourceScope(ScopeCode.SERVICE, name); decoder.setSearchPath(path); DefaultLineage lineage = null; String value = stringValue(HISTORY); if (value != null) { lineage = new DefaultLineage(); lineage.setStatement(new SimpleInternationalString(value)); value = stringValue(SOURCE); if (value != null) { if (lineage == null) lineage = new DefaultLineage(); addCompleteMetadata(createURI(stringValue(METADATA_LINK))); return metadata;
v = variable.getAttributeValues(CDM.ADD_OFFSET, true); if (v.length == 1) offset = ((Number) v[0]).doubleValue(); setTransferFunction(scale, offset); addContentType(forCodeName(CoverageContentType.class, stringValue(ACDD.coverage_content_type)));
addExtent(stringValue(GEOGRAPHIC_IDENTIFIER)); double min = valueOf(zmin, c); double max = valueOf(zmax, c); if (CF.POSITIVE_DOWN.equals(stringValue(VERTICAL.POSITIVE))) { final double tmp = min; min = -max; final Number tmax = decoder.numericValue(TIME.MAXIMUM); if (tmin != null || tmax != null) { final String symbol = stringValue(TIME.UNITS); if (symbol != null) { final Date[] dates = decoder.numberToDate(symbol, tmin, tmax);