Tabnine Logo
DateHelper.parseDate
Code IndexAdd Tabnine to your IDE (free)

How to use
parseDate
method
in
org.esa.snap.utils.DateHelper

Best Java code snippets using org.esa.snap.utils.DateHelper.parseDate (Showing top 20 results out of 315)

origin: senbox-org/s2tbx

@Override
public ProductData.UTC getCenterTime() {
  //computed the acquisition date
  String dateString = getAttributeValue(MuscateConstants.PATH_ACQUISITION_DATE, MuscateConstants.VALUE_NOT_DATE);
  return parseDate(dateString, MuscateConstants.DATE_FORMAT);
}
origin: senbox-org/s2tbx

public ProductData.UTC getProductionDate() {
  ProductData.UTC prodDate = null;
  String stringData = getAttributeValue(Spot6Constants.PATH_VOL_PRODUCTION_DATE, null);
  if (stringData != null && !stringData.isEmpty()) {
    prodDate = DateHelper.parseDate(stringData, Spot6Constants.SPOT6_UTC_DATE_FORMAT);
  }
  return prodDate;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductEndTime() {
  ProductData.UTC date = null;
  String value = getAttributeSiblingValue(Constants.PATH_IMG_LOCATION_TYPE, "TopCenter", Constants.PATH_IMG_TIME, null);
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Constants.UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

public ProductData.UTC getProductionDate() {
  ProductData.UTC prodDate = null;
  String stringData = getAttributeValue(Constants.PATH_VOL_PRODUCTION_DATE, null);
  if (stringData != null && !stringData.isEmpty()) {
    prodDate = DateHelper.parseDate(stringData, Constants.UTC_DATE_FORMAT);
  }
  return prodDate;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductStartTime() {
  ProductData.UTC date = null;
  String value = getAttributeSiblingValue(Spot6Constants.PATH_IMG_LOCATION_TYPE, "BottomCenter", Spot6Constants.PATH_IMG_TIME, null);
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Spot6Constants.SPOT6_UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductEndTime() {
  ProductData.UTC date = null;
  String value = getAttributeSiblingValue(Spot6Constants.PATH_IMG_LOCATION_TYPE, "TopCenter", Spot6Constants.PATH_IMG_TIME, null);
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Spot6Constants.SPOT6_UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getCenterTime() {
  ProductData.UTC date = null;
  String value = getAttributeSiblingValue(Spot6Constants.PATH_IMG_LOCATION_TYPE, "Center", Spot6Constants.PATH_IMG_TIME, null);
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Spot6Constants.SPOT6_UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductStartTime() {
  ProductData.UTC date = null;
  String value = getAttributeSiblingValue(Constants.PATH_IMG_LOCATION_TYPE, "BottomCenter", Constants.PATH_IMG_TIME, null);
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Constants.UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getCenterTime() {
  ProductData.UTC date = null;
  String value = getAttributeSiblingValue(Constants.PATH_IMG_LOCATION_TYPE, "Center", Constants.PATH_IMG_TIME, null);
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Constants.UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

public ProductData.UTC getFileDate() {
  ProductData.UTC fileDate = null;
  MetadataElement currentElement = root.getElement(NITFFields.TAG_FILE_HEADER);
  if (currentElement != null) {
    try {
      fileDate = DateHelper.parseDate(currentElement.getAttributeString(NITFFields.FDT, ""), "ddHHmmss'Z'MMMyy");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  return fileDate;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductEndTime() {
  ProductData.UTC date = null;
  String value = null;
  try {
    value = getAttributeValue(WorldView2Constants.PATH_END_TIME, null);
  } catch (Exception e) {
    warn(MISSING_ELEMENT_WARNING, WorldView2Constants.PATH_END_TIME);
  }
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, WorldView2Constants.WORLDVIEW2_UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductStartTime() {
  ProductData.UTC date = null;
  String value = null;
  try{
    value = getAttributeValue(WorldView2Constants.PATH_START_TIME, null);
  } catch (Exception e) {
    warn(MISSING_ELEMENT_WARNING, WorldView2Constants.PATH_START_TIME);
  }
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, WorldView2Constants.WORLDVIEW2_UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductStartTime() {
  ProductData.UTC date = null;
  String value = null;
  try{
    value = getAttributeValue(Kompsat2Constants.PATH_START_TIME, null);
  } catch (Exception e) {
    warn(MISSING_ELEMENT_WARNING, Kompsat2Constants.PATH_START_TIME);
  }
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Kompsat2Constants.KOMPSAT2_UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

@Override
public ProductData.UTC getProductEndTime() {
  ProductData.UTC date = null;
  String value = null;
  try {
    value = getAttributeValue(Kompsat2Constants.PATH_END_TIME, null);
  } catch (Exception e) {
    warn(MISSING_ELEMENT_WARNING, Kompsat2Constants.PATH_END_TIME);
  }
  if (value != null && !value.isEmpty()) {
    date = DateHelper.parseDate(value, Kompsat2Constants.KOMPSAT2_UTC_DATE_FORMAT);
  }
  return date;
}
origin: senbox-org/s2tbx

public ProductData.UTC getCenterTime() {
  ProductData.UTC centerTime = null;
  MetadataElement currentElement;
  if (((currentElement = rootElement.getElement(SpotConstants.TAG_DATA_STRIP)) != null) &&
      ((currentElement = currentElement.getElement(SpotConstants.TAG_SENSOR_CONFIGURATION)) != null) &&
      ((currentElement = currentElement.getElement(SpotConstants.TAG_TIME_STAMP)) != null)) {
    String stringData = currentElement.getAttributeString(SpotConstants.TAG_SCENE_CENTER_TIME);
    centerTime = DateHelper.parseDate(stringData, SpotConstants.UTC_DATE_FORMAT);
  } else {
    logger.warning(String.format(MISSING_ELEMENT_WARNING, SpotConstants.TAG_SCENE_CENTER_TIME));
  }
  return centerTime;
}
origin: senbox-org/s2tbx

/**
 * Reads the date of the acquisition of the image, as it appears in the metadata file, under the tag METADATA/HEADER/DATE_PDV
 *
 * @return the UTC date representing the date of the acquisition of the image, as it appears in the metadata file
 */
public ProductData.UTC getDatePdv() {
  String dateStr = null;
  ProductData.UTC dateValue = null;
  MetadataElement currentElement;
  if (((currentElement = rootElement.getElement(SpotConstants.SPOT4_TAKE5_TAG_HEADER)) != null)) {
    dateStr = currentElement.getAttributeString(SpotConstants.SPOT4_TAKE5_TAG_DATE_PDV);
  }
  if (dateStr != null) {
    dateValue = DateHelper.parseDate(dateStr, SpotConstants.SPOT4_TAKE5_UTC_DATE_FORMAT);
  }
  return dateValue;
}
origin: senbox-org/s2tbx

public ProductData.UTC getCenterTime() {
  ProductData.UTC centerTime = null;
  String stringDate = getAttributeValue(DeimosConstants.PATH_SCENE_CENTER_DATE, null);
  if (stringDate != null) {
    String stringTime = getAttributeValue(DeimosConstants.PATH_SCENE_CENTER_TIME, null);
    if (stringTime == null) {
      warn(MISSING_ELEMENT_WARNING, DeimosConstants.PATH_SCENE_CENTER_TIME);
      stringTime = "00:00:00";
    }
    centerTime = parseDate(stringDate + " " + stringTime, DeimosConstants.DEIMOS_DATE_FORMAT);
  } else {
    warn(MISSING_ELEMENT_WARNING, DeimosConstants.PATH_SCENE_CENTER_DATE);
  }
  return centerTime;
}
origin: senbox-org/s2tbx

  for (MetadataElement element : bandSpecificMetadataElements) {
    if (RapidEyeConstants.TAG_BAND_SPECIFIC_METADATA.equals(element.getName())) {
      ProductData.UTC currentTime = DateHelper.parseDate(element.getAttributeString(RapidEyeConstants.TAG_START_DATE_TIME, null),
                                RapidEyeConstants.UTC_DATE_FORMAT);
      if (bandsStartTime == null) {
productStartTime = DateHelper.parseDate(currentElement.getAttributeString(RapidEyeConstants.TAG_BEGIN_POSITION, null),
                    RapidEyeConstants.UTC_DATE_FORMAT);
origin: senbox-org/s2tbx

  for (MetadataElement element : bandSpecificMetadataElements) {
    if (RapidEyeConstants.TAG_BAND_SPECIFIC_METADATA.equals(element.getName())) {
      ProductData.UTC currentTime = DateHelper.parseDate(element.getAttributeString(RapidEyeConstants.TAG_END_DATE_TIME, null),
                                RapidEyeConstants.UTC_DATE_FORMAT);
      if (bandsEndTime == null) {
productEndTime = DateHelper.parseDate(currentElement.getAttributeString(RapidEyeConstants.TAG_END_POSITION, null),
                   RapidEyeConstants.UTC_DATE_FORMAT);
origin: senbox-org/s2tbx

                "detector_footprint-B01:detector_footprint-B02:detector_footprint-B03:detector_footprint-B04:detector_footprint-B05:detector_footprint-B06:detector_footprint-B07:detector_footprint-B08:" +
                "detector_footprint-B8A:detector_footprint-B09:detector_footprint-B10:detector_footprint-B11:detector_footprint-B12:defective:saturation");
product.setStartTime(parseDate(metadata.getAcquisitionDate(), "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"));
product.setEndTime(parseDate(metadata.getAcquisitionDate(), "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"));
org.esa.snap.utilsDateHelperparseDate

Javadoc

Utility method for returning a ProductData.UTC date from a string using the given date format. Why not using ProductData.UTC.parse(text, pattern) method? Because it errors in the case of a format like dd-MM-yyyy'T'HH:mm:ss.SSSSSS (which should be perfectly fine).

Popular methods of DateHelper

  • average
    Computes the median (average) of two ProductData.UTC data structures.

Popular in Java

  • Creating JSON documents from java classes using gson
  • putExtra (Intent)
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now