gpt4 book ai didi

org.apache.sis.io.wkt.WKTFormat.getWarnings()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 20:23:05 26 4
gpt4 key购买 nike

本文整理了Java中org.apache.sis.io.wkt.WKTFormat.getWarnings()方法的一些代码示例,展示了WKTFormat.getWarnings()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WKTFormat.getWarnings()方法的具体详情如下:
包路径:org.apache.sis.io.wkt.WKTFormat
类名称:WKTFormat
方法名:getWarnings

WKTFormat.getWarnings介绍

[英]If warnings occurred during the last WKT #parse(CharSequence,ParsePosition) or #format(Object,Appendable), returns the warnings. Otherwise returns null. The warnings are cleared every time a new object is parsed or formatted.
[中]如果在上一次WKT#parse(CharSequence,ParsePosition)或#format(Object,Appendable)期间出现警告,则返回警告。否则返回null。每次解析或格式化新对象时,警告都会被清除。

代码示例

代码示例来源:origin: Geomatys/geotoolkit

/**
 * Formats the given CRS as a string.
 *
 * @throws ContentFormatException if the given CRS is not formattable as a WKT.
 */
private static String format(final CoordinateReferenceSystem crs) throws ContentFormatException {
  final WKTFormat format = new WKTFormat(null, null);
  format.setConvention(Convention.WKT1);
  format.setIndentation(WKTFormat.SINGLE_LINE);
  final String wkt = format.format(crs);
  final Warnings warning = format.getWarnings();
  if (warning != null) {
    throw new ContentFormatException(warning.toString());
  }
  return wkt;
}

代码示例来源:origin: apache/sis

/**
 * Prints the coordinate operation or math transform in Well Known Text format.
 * This information is printed only if the {@code --verbose} option was specified.
 */
private void printDetails() throws IOException {
  final boolean debug = options.containsKey(Option.DEBUG);
  final WKTFormat f = new WKTFormat(locale, timezone);
  if (colors) f.setColors(Colors.DEFAULT);
  f.setConvention(convention);
  CharSequence[] lines = CharSequences.splitOnEOL(f.format(debug ? operation.getMathTransform() : operation));
  for (int i=0; i<lines.length; i++) {
    if (i == 0) {
      printHeader(Vocabulary.Keys.Details);
    } else {
      printCommentLinePrefix();
      outHeader.nextColumn();
    }
    outHeader.append(lines[i]);
    outHeader.nextLine();
  }
  final Warnings warnings = f.getWarnings();
  if (warnings != null) {
    lines = CharSequences.splitOnEOL(warnings.toString());
    if (lines.length != 0) {                                            // Paranoiac check.
      printHeader(Vocabulary.Keys.Note);
      outHeader.append(lines[0]);
      outHeader.nextLine();
    }
  }
}

代码示例来源:origin: apache/sis

final Warnings warnings = f.getWarnings();
if (warnings != null && !warnings.getExceptions().isEmpty()) {
  print(code, "WARNING", warnings.getException(0));

代码示例来源:origin: apache/sis

format = new WKTFormat(null, null);
final String   wkt      = format.format(pm);
final Warnings warnings = format.getWarnings();
assertNotNull("warnings", warnings);
assertEquals ("warnings.numMessages", 1, warnings.getNumMessages());

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com