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

x33g5p2x  于2022-01-28 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(77)

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

Query.getVersion介绍

[英]Defines version or version range requested.

From WFS Spec: The version attribute is included in order to accommodate systems that support feature versioning. A value of #ALLindicates that all versions of a feature should be fetched. Otherwise an integer, n, can be specified to return the n th version of a feature. The version numbers start at '1' which is the oldest version. If a version value larger than the largest version is specified then the latest version is return. The default action shall be for the query to return the latest version. Systems that do not support versioning can ignore the parameter and return the only version that they have.

GeoTools employs the following options:

  • #setVersion(Date): "date: dow mon dd hh:mm:ss zzz yyyy"
  • #setVersion(int): "index"
  • #setVersion(org.opengis.filter.identity.Version.Action)): "PREVIOUS", "LAST", "NEXT", "FIRST", "ALL"
  • #setVersion(Date, Date): "start: dow mon dd hh:mm:ss zzz yyyy end: dow mon dd hh:mm:ss zzz yyyy"
    [中]定义请求的版本或版本范围。
    来自WFS规范:版本属性包括在内,以适应支持功能版本控制的系统。#alli的值表示应获取功能的所有版本。否则,可以指定一个整数n来返回特征的第n个版本。版本号从“1”开始,这是最早的版本。如果指定的版本值大于最大版本,则返回最新版本。默认操作是查询返回最新版本。不支持版本控制的系统可以忽略该参数并返回其唯一的版本。
    GeoTools采用以下选项:
    *#设置版本(日期):“日期:道指周一至dd hh:mm:ss zzz yyyy”
    *#设置版本(int):“索引”
    *#setVersion(org.opengis.filter.identity.Version.Action)):“上一个”、“最后一个”、“下一个”、“第一个”、“全部”
    *#设置版本(日期,日期):“开始:道琼斯工业平均指数周一日hh:mm:ss zzz yyyy结束:道琼斯工业平均指数周一日hh:mm:ss zzz yyyy”

代码示例

代码示例来源:origin: geotools/geotools

/**
 * Hashcode based on all parameters other than the handle.
 *
 * @return hascode for this Query
 */
@Override
public int hashCode() {
  String[] n = getPropertyNames();
  return ((n == null) ? (-1) : ((n.length == 0) ? 0 : (n.length | n[0].hashCode())))
      | getMaxFeatures()
      | ((getFilter() == null) ? 0 : getFilter().hashCode())
      | ((getTypeName() == null) ? 0 : getTypeName().hashCode())
      | ((getVersion() == null) ? 0 : getVersion().hashCode())
      | ((getCoordinateSystem() == null) ? 0 : getCoordinateSystem().hashCode())
      | ((getCoordinateSystemReproject() == null)
          ? 0
          : getCoordinateSystemReproject().hashCode())
      | getStartIndex();
}

代码示例来源:origin: geotools/geotools

/** Test of getVersion method, of class org.geotools.data.Query. */
public void testVersion() {
  // System.out.println("testGetVersion");
  Query query = new Query();
  assertNull(query.getVersion());
}

代码示例来源:origin: geotools/geotools

? (other.getTypeName() == null)
    : getTypeName().equals(other.getTypeName()))
&& ((getVersion() == null)
    ? (other.getVersion() == null)
    : getVersion().equals(other.getVersion()))
&& ((getCoordinateSystem() == null)
    ? (other.getCoordinateSystem() == null)

代码示例来源:origin: geotools/geotools

if (firstQuery.getVersion() != null) {
  if (secondQuery.getVersion() != null
      && !secondQuery.getVersion().equals(firstQuery.getVersion()))
    throw new IllegalArgumentException(
        "First and second query refer different versions");
  version = firstQuery.getVersion();
} else {
  version = secondQuery.getVersion();

代码示例来源:origin: geotools/geotools

: getTypeName().equals(other.getTypeName()))
&& ((getVersion() == null)
    ? (other.getVersion() == null)
    : getVersion().equals(other.getVersion()))
&& ((getCoordinateSystem() == null)
    ? (other.getCoordinateSystem() == null)

代码示例来源:origin: geotools/geotools

: getTypeName().equals(other.getTypeName()))
&& ((getVersion() == null)
    ? (other.getVersion() == null)
    : getVersion().equals(other.getVersion()))
&& ((getCoordinateSystem() == null)
    ? (other.getCoordinateSystem() == null)

代码示例来源:origin: geotools/geotools

/**
 * Copy contructor.
 *
 * @param query the query to copy
 */
public Query(Query query) {
  this(
      query.getTypeName(),
      query.getNamespace(),
      query.getFilter(),
      query.getMaxFeatures(),
      query.getProperties(),
      query.getHandle());
  this.sortBy = query.getSortBy();
  this.coordinateSystem = query.getCoordinateSystem();
  this.coordinateSystemReproject = query.getCoordinateSystemReproject();
  this.version = query.getVersion();
  this.hints = query.getHints();
  this.startIndex = query.getStartIndex();
  this.alias = query.getAlias();
  this.joins = new ArrayList();
  for (Join j : query.getJoins()) {
    this.joins.add(new Join(j));
  }
}

代码示例来源:origin: geotools/geotools

/**
   * Copy contructor, clones the state of a generic Query into a DefaultQuery
   *
   * @param query
   */
  public DefaultQuery(Query query) {
    this(
        query.getTypeName(),
        query.getNamespace(),
        query.getFilter(),
        query.getMaxFeatures(),
        query.getProperties(),
        query.getHandle());
    this.sortBy = query.getSortBy();
    this.coordinateSystem = query.getCoordinateSystem();
    this.coordinateSystemReproject = query.getCoordinateSystemReproject();
    this.version = query.getVersion();
    this.hints = query.getHints();
    this.startIndex = query.getStartIndex();
    this.alias = query.getAlias();
    this.joins = query.getJoins();
  }
}

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

if(firstQuery.getVersion() != null) {
  if(secondQuery.getVersion() != null && !secondQuery.getVersion().equals(firstQuery.getVersion()))
    throw new IllegalArgumentException("First and second query refer different versions");
  version = firstQuery.getVersion();
} else {
  version = secondQuery.getVersion();

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

&& ((getTypeName() == null) ? (other.getTypeName() == null)
              : getTypeName().equals(other.getTypeName()))
&& ((getVersion() == null) ? (other.getVersion() == null)
              : getVersion().equals(other.getVersion()))
&& ((getCoordinateSystem() == null) ? (other.getCoordinateSystem() == null)
                  : getCoordinateSystem()

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

&& ((getTypeName() == null) ? (other.getTypeName() == null)
              : getTypeName().equals(other.getTypeName()))
&& ((getVersion() == null) ? (other.getVersion() == null)
              : getVersion().equals(other.getVersion()))
&& ((getCoordinateSystem() == null) ? (other.getCoordinateSystem() == null)
                  : getCoordinateSystem().equals(other.getCoordinateSystem()))

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

&& ((getTypeName() == null) ? (other.getTypeName() == null)
              : getTypeName().equals(other.getTypeName()))
&& ((getVersion() == null) ? (other.getVersion() == null)
              : getVersion().equals(other.getVersion()))
&& ((getCoordinateSystem() == null) ? (other.getCoordinateSystem() == null)
                  : getCoordinateSystem()

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

if ((query.getVersion() != null)
    && !"".equals(query.getVersion())) {
  attributes.addAttribute(WFSSchema.NAMESPACE.toString(),
    attrs[2].getName(), null, "string",
    query.getVersion());

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

if (firstQuery.getVersion() != null) {
  if (secondQuery.getVersion() != null
      && !secondQuery.getVersion().equals(firstQuery.getVersion()))
    throw new IllegalArgumentException(
        "First and second query refer different versions");
  version = firstQuery.getVersion();
} else {
  version = secondQuery.getVersion();

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

/**
 * Given an original query and a revision info, builds an equivalent query that will work
 * against the specified revision
 * 
 * @param query
 * @param ri
 * @return
 * @throws FactoryConfigurationError
 * @throws IOException
 */
DefaultQuery buildVersionedQuery(Query query) throws IOException {
  RevisionInfo ri = new RevisionInfo(query.getVersion());
  // build a filter that limits the number
  Filter newFilter = buildVersionedFilter(query.getTypeName(), query.getFilter(), ri);
  DefaultQuery versionedQuery = new DefaultQuery(query);
  versionedQuery.setPropertyNames(filterPropertyNames(query));
  versionedQuery.setFilter(newFilter);
  return versionedQuery;
}

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

/**
 * Copy contructor, clones the state of a generic Query into a DefaultQuery
 * @param query
 */
public DefaultQuery(Query query) {
 this(query.getTypeName(), query.getNamespace(), query.getFilter(), query.getMaxFeatures(),
   query.getPropertyNames(), query.getHandle());
 this.sortBy = query.getSortBy();
 this.coordinateSystem = query.getCoordinateSystem();
 this.coordinateSystemReproject = query.getCoordinateSystemReproject();
 this.version = query.getVersion();
 this.hints = query.getHints();
 this.startIndex = query.getStartIndex();
}

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

/**
 * Copy contructor, clones the state of a generic Query into a DefaultQuery
 * @param query
 */
public DefaultQuery(Query query) {
 this(query.getTypeName(), query.getNamespace(), query.getFilter(), query.getMaxFeatures(),
   query.getProperties(), query.getHandle());
 this.sortBy = query.getSortBy();
 this.coordinateSystem = query.getCoordinateSystem();
 this.coordinateSystemReproject = query.getCoordinateSystemReproject();
 this.version = query.getVersion();
 this.hints = query.getHints();
 this.startIndex = query.getStartIndex();
 this.alias = query.getAlias();
 this.joins = query.getJoins();
}

相关文章