org.geotools.factory.GeoTools.getVersion()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(128)

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

GeoTools.getVersion介绍

[英]Reports back the version of GeoTools being used.
[中]报告正在使用的GeoTools的版本。

代码示例

代码示例来源:origin: org.geoserver.extension/gs-netcdf-out

@Override
public Optional<String> getVersion() {
  Version v = GeoTools.getVersion(NetCDFUtilities.class);
  if (v == null) {
    return Optional.empty();
  }
  return Optional.ofNullable(v.toString());
}

代码示例来源:origin: org.geoserver.extension/gs-grib

@Override
public Optional<String> getVersion() {
  Version v = GeoTools.getVersion(NetCDFUtilities.class);
  if (v == null) {
    return Optional.empty();
  }
  return Optional.ofNullable(v.toString());
}

代码示例来源:origin: org.geotools/gt-metadata

/**
 * Returns summary information about the GeoTools version and the host environment.
 * 
 * @return information as a String
 */
public static String getEnvironmentInfo() {
  final String newline = String.format("%n");
  final String indent = "    ";
  
  final StringBuilder sb = new StringBuilder();
  sb.append("GeoTools version ").append(getVersion().toString());
  if (sb.toString().endsWith("SNAPSHOT")) {
    sb.append(" (built from r").append(getBuildRevision().toString()).append(")");
  }
  sb.append(newline).append("Java version: ");
  sb.append(System.getProperty("java.version"));
  sb.append(newline).append("Operating system: ");
  sb.append(System.getProperty("os.name")).append(' ').append(System.getProperty("os.version"));
  
  return sb.toString();
}

代码示例来源:origin: org.geotools/gt-metadata

/**
 * A helper method for {@linkplain #getGeoToolsJarInfo} which scans the 
 * classpath looking for GeoTools jars matching the current version.
 * 
 * @return a list of jar names 
 */
private static List<String> getGeoToolsJars() {
  final Pattern pattern = Pattern.compile(".*\\/" + getVersion() + "\\/(gt-.*jar$)");
  final List<String> jarNames = new ArrayList<String>();
  
  String pathSep = System.getProperty("path.separator");
  String classpath = System.getProperty("java.class.path");
  StringTokenizer st = new StringTokenizer(classpath, pathSep);
  while (st.hasMoreTokens()) {
    String path = st.nextToken();
    Matcher matcher = pattern.matcher(path);
    if (matcher.find()) {
      jarNames.add(matcher.group(1));
    }
  }
  
  Collections.sort(jarNames);
  return jarNames;
}

代码示例来源:origin: org.geotools/gt-wfs-ng

public String newRequestHandle(WFSOperationType operation) {
  StringBuilder handle =
      new StringBuilder("GeoTools ")
          .append(GeoTools.getVersion())
          .append("(")
          .append(GeoTools.getBuildRevision())
          .append(") WFS ")
          .append(getVersion())
          .append(" DataStore @");
  try {
    handle.append(InetAddress.getLocalHost().getHostName());
  } catch (Exception ignore) {
    handle.append("<uknown host>");
  }
  AtomicLong reqHandleSeq = requestHandleSequences.get(operation);
  handle.append('#').append(reqHandleSeq.incrementAndGet());
  return handle.toString();
}

代码示例来源:origin: org.geotools/gt-arcsde

/**
 * Sets the metadata information.
 */
private void setInfo() {
  Map<String, String> info = new HashMap<String, String>();
  info.put("name", "ArcSDE Raster");
  info.put("description", "ArcSDE Raster Format");
  info.put("vendor", "Geotools ");
  info.put("docURL", "");
  info.put("version", GeoTools.getVersion().toString());
  mInfo = info;
  readParameters = new ParameterGroup(new DefaultParameterDescriptorGroup(mInfo,
      new GeneralParameterDescriptor[] { READ_GRIDGEOMETRY2D, OVERVIEW_POLICY }));
}

代码示例来源:origin: org.geoserver.web/web-core

public AboutGeoServerPage() {
    add(new Label("geotoolsVersion", GeoTools.getVersion().toString()));
    add(new Label("geotoolsRevision", GeoTools.getBuildRevision().toString()));
  }
}

代码示例来源:origin: org.geoserver.extension/gs-netcdf-out

@Override
public Optional<String> getMessage() {
  String message = "NETCDF-4 Binary Available: " + NetCDFUtilities.isNC4CAvailable();
  message += "\nNc4prototypes Version: " + GeoTools.getVersion(Nc4prototypes.class);
  if (NetCDFUtilities.isNC4CAvailable()) {
    message += "\nc_inq_libvers: " + Nc4Version();
  }
  return Optional.ofNullable(message);
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
   * Reports the GeoTools {@linkplain #getVersion version} number to the
   * {@linkplain System#out standard output stream}.
   */
  public static void main(String[] args) {
    final Arguments arguments = new Arguments(args);
    args = arguments.getRemainingArguments(0);
    arguments.out.print("GeoTools version ");
    arguments.out.println(getVersion());
    final Hints hints = getDefaultHints();
    if (hints!=null && !hints.isEmpty()) {
      arguments.out.println(hints);
    }
  }
}

代码示例来源:origin: org.geotools/gt-metadata

/**
   * Reports the GeoTools {@linkplain #getVersion version} number to the
   * {@linkplain System#out standard output stream}.
   *
   * @param args Command line arguments.
   */
  public static void main(String[] args) {
    final Arguments arguments = new Arguments(args);
    args = arguments.getRemainingArguments(0);
    arguments.out.print("GeoTools version ");
    arguments.out.println(getVersion());
    final Hints hints = getDefaultHints();
    if (hints!=null && !hints.isEmpty()) {
      arguments.out.println(hints);
    }
  }
}

代码示例来源:origin: org.geoserver.web/gs-web-core

public AboutGeoServerPage() {
  add(new Label("geotoolsVersion", GeoTools.getVersion().toString()));
  add(new Label("geotoolsRevision", GeoTools.getBuildRevision()));
  add(new Label("geowebcacheVersion", getGwcVersion()));
  add(new Label("geowebcacheRevision", getGwcRevision()));
}

代码示例来源:origin: robward-scisys/sldeditor

/**
 * Creates the text list.
 *
 * @return the list
 */
private List<TextPosition> createTextList() {
  List<TextPosition> textList = new ArrayList<>();
  // Application version string
  Point textPosition = AppSplashScreen.getTextPosition();
  textList.add(new TextPosition(AppSplashScreen.getVersionString(), textPosition));
  // GeoTools version string
  Point p =
      new Point(
          (int) textPosition.getX(),
          (int) (textPosition.getY() + AppSplashScreen.getFont().getSize2D()));
  String geoToolsVersionString =
      String.format(
          "%s GeoTools %s",
          Localisation.getString(AboutDialog.class, "AboutDialog.basedOn"),
          GeoTools.getVersion().toString());
  textList.add(new TextPosition(geoToolsVersionString, p));
  return textList;
}

代码示例来源:origin: robward-scisys/sldeditor

/**
 * Splash text.
 *
 * @param str the str
 */
public static void splashText(final String str) {
  logger.info(str);
  if (splashScreenObj != null && splashScreenObj.isVisible()) {
    // draw the text
    splashGraphics.setPaint(Color.BLACK);
    splashGraphics.setFont(getFont());
    splashGraphics.setRenderingHint(
        RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
    splashGraphics.setColor(Color.black);
    splashGraphics.drawString(
        str, (int) getTextPosition().getX(), (int) getTextPosition().getY());
    String geoToolsVersionString =
        String.format(
            "%s GeoTools %s",
            Localisation.getString(AboutDialog.class, "AboutDialog.basedOn"),
            GeoTools.getVersion().toString());
    splashGraphics.drawString(
        geoToolsVersionString,
        (int) getTextPosition().getX(),
        (int) (getTextPosition().getY() + AppSplashScreen.getFont().getSize2D()));
    // make sure it's displayed
    splashScreenObj.update();
  }
}

代码示例来源:origin: org.geotools/gt-wfs

client = new HttpClient();
client.getParams().setParameter("http.useragent",
    "GeoTools " + GeoTools.getVersion() + " WFS DataStore");

代码示例来源:origin: org.geotools/gt-wfs

getFeature.setOutputFormat(query.getOutputFormat());
getFeature.setHandle("GeoTools " + GeoTools.getVersion() + " WFS DataStore");
Integer maxFeatures = query.getMaxFeatures();
if (maxFeatures != null) {

相关文章