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

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

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

Query.retrieveAllProperties介绍

[英]Convenience method to determine if the query should retrieve all properties defined in the schema of the feature data source. This is equivalent to testing if #getPropertyNames() returns #ALL_NAMES.
[中]确定查询是否应检索要素数据源模式中定义的所有特性的便捷方法。这相当于测试#getPropertyNames()是否返回#ALL_名称。

代码示例

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

String[] propNames = null;
if (query.retrieveAllProperties()) {
  List<String> props = new ArrayList();

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

String[] propNames = null;
if (query.retrieveAllProperties()) {
  propNames = new String[schema.getAttributeCount()];

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

/** Test of retrieveAllProperties method, of class org.geotools.data.Query. */
public void testRetrieveAllProperties() {
  // System.out.println("testRetrieveAllProperties");
  Query query = new Query();
  assertTrue(query.retrieveAllProperties());
  query.setPropertyNames(new String[] {"foo", "bar"});
  assertFalse(query.retrieveAllProperties());
  query.setPropertyNames(Query.ALL_NAMES);
  assertTrue(query.retrieveAllProperties());
  query.setProperties(Query.ALL_PROPERTIES);
  assertTrue(query.retrieveAllProperties());
  query.setPropertyNames(new String[] {"foo", "bar"});
  query.setProperties(Query.ALL_PROPERTIES);
  assertTrue(query.retrieveAllProperties());
}

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

public SimpleFeatureType getQueryType(Query query) throws IOException {
  final String typeName = query.getTypeName();
  final String propertyNames[] = query.getPropertyNames();
  final FeatureTypeInfo typeInfo = typeInfoCache.getFeatureTypeInfo(typeName);
  final SimpleFeatureType completeSchema = typeInfo.getFeatureType();
  SimpleFeatureType featureType = completeSchema;
  if (!query.retrieveAllProperties() || query.getCoordinateSystem() != null) {
    try {
      featureType =
          DataUtilities.createSubType(
              featureType, propertyNames, query.getCoordinateSystem());
    } catch (SchemaException e) {
      LOGGER.log(Level.FINEST, e.getMessage(), e);
      throw new DataSourceException("Could not create Feature Type for query", e);
    }
  }
  return featureType;
}

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

&& (retrieveAllProperties() == other.retrieveAllProperties())
&& (getMaxFeatures() == other.getMaxFeatures())
&& ((getFilter() == null)

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

&& (retrieveAllProperties() == other.retrieveAllProperties())
&& (getMaxFeatures() == other.getMaxFeatures())
&& ((getFilter() == null)

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

&& (retrieveAllProperties() == other.retrieveAllProperties())
&& (getMaxFeatures() == other.getMaxFeatures())
&& ((getFilter() == null)

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

if (query.retrieveAllProperties()) { // we can use the originalType as is
  schema = featureSource.getSchema();
} else {

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

AttributeDescriptor[] schemaTypes = (AttributeDescriptor[]) getSchema().getAttributeDescriptors().toArray(new AttributeDescriptor[getSchema().getAttributeDescriptors().size()]);
if (query.retrieveAllProperties()) {
  return schemaTypes;
} else {

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

String[] propNames = null;
if (query.retrieveAllProperties()) {
  propNames = new String[schema.getAttributeCount()];

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

String[] propNames = null;
if (query.retrieveAllProperties()) {
  propNames = new String[schema.getAttributeCount()];

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

public SimpleFeatureType getQueryType(Query query) throws IOException {
  final String typeName = query.getTypeName();
  final String propertyNames[] = query.getPropertyNames();
  final FeatureTypeInfo typeInfo = typeInfoCache.getFeatureTypeInfo(typeName);
  final SimpleFeatureType completeSchema = typeInfo.getFeatureType();
  SimpleFeatureType featureType = completeSchema;
  if (!query.retrieveAllProperties() || query.getCoordinateSystem() != null) {
    try {
      featureType = DataUtilities.createSubType(featureType, propertyNames,
          query.getCoordinateSystem());
    } catch (SchemaException e) {
      LOGGER.log(Level.FINEST, e.getMessage(), e);
      throw new DataSourceException("Could not create Feature Type for query", e);
    }
  }
  return featureType;
}

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

&& (retrieveAllProperties() == other.retrieveAllProperties())
&& (getMaxFeatures() == other.getMaxFeatures())
&& ((getFilter() == null) ? (other.getFilter() == null)

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

&& (retrieveAllProperties() == other.retrieveAllProperties())
&& (getMaxFeatures() == other.getMaxFeatures())
&& ((getFilter() == null) ? (other.getFilter() == null)

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

&& (retrieveAllProperties() == other.retrieveAllProperties())
&& (getMaxFeatures() == other.getMaxFeatures())
&& ((getFilter() == null) ? (other.getFilter() == null)

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

/**
 * Get propertyNames in a safe manner.
 *
 * <p>
 * Method will figure out names from the schema for query.getTypeName(), if
 * query getPropertyNames() is <code>null</code>, or
 * query.retrieveAllProperties is <code>true</code>.
 * </p>
 *
 * @param query
 *
 *
 * @throws IOException
 */
protected String[] propertyNames(Query query) throws IOException {
  String[] names = query.getPropertyNames();
  if ((names == null) || query.retrieveAllProperties()) {
    String typeName = query.getTypeName();
    FeatureType schema = getSchema(typeName);
    names = new String[schema.getAttributeCount()];
    for (int i = 0; i < schema.getAttributeCount(); i++) {
      names[i] = schema.getAttributeType(i).getName();
    }
  }
  return names;
}

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

if (query.retrieveAllProperties()) { // we can use the originalType as is                
  schema = featureSource.getSchema();
} else {

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

SimpleFeatureType schemaNew = schema;
if(!query.retrieveAllProperties()) {
  try {
    schemaNew = DataUtilities.createSubType(schema, query.getPropertyNames());

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

if (!query.retrieveAllProperties()) {
  try {
    schemaNew = DataUtilities.createSubType(schema, query.getPropertyNames());

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

if (query.retrieveAllProperties()) { // we can use the origionalType as is                
  schema = featureSource.getSchema();
} else {

相关文章