当前位置: 首页>>代码示例>>Java>>正文


Java AttributeDescriptor.getLocalName方法代码示例

本文整理汇总了Java中org.opengis.feature.type.AttributeDescriptor.getLocalName方法的典型用法代码示例。如果您正苦于以下问题:Java AttributeDescriptor.getLocalName方法的具体用法?Java AttributeDescriptor.getLocalName怎么用?Java AttributeDescriptor.getLocalName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opengis.feature.type.AttributeDescriptor的用法示例。


在下文中一共展示了AttributeDescriptor.getLocalName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: feature2AlphanumericToHashmap

import org.opengis.feature.type.AttributeDescriptor; //导入方法依赖的package包/类
public static LinkedHashMap<String, String> feature2AlphanumericToHashmap( SimpleFeature feature ) {
    LinkedHashMap<String, String> attributes = new LinkedHashMap<>();
    List<AttributeDescriptor> attributeDescriptors = feature.getFeatureType().getAttributeDescriptors();
    int index = 0;
    for( AttributeDescriptor attributeDescriptor : attributeDescriptors ) {
        if (!(attributeDescriptor instanceof GeometryDescriptor)) {
            String fieldName = attributeDescriptor.getLocalName();
            Object attribute = feature.getAttribute(index);
            if (attribute == null) {
                attribute = "";
            }
            String value = attribute.toString();
            attributes.put(fieldName, value);
        }
        index++;
    }
    return attributes;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:19,代码来源:FeatureUtilities.java

示例2: selectColumns

import org.opengis.feature.type.AttributeDescriptor; //导入方法依赖的package包/类
void selectColumns(SimpleFeatureType featureType, String prefix, Query query, StringBuilder sql) 
    throws IOException {
            
    //other columns
    for (AttributeDescriptor att : featureType.getAttributeDescriptors()) {
        String columnName = att.getLocalName();
        
        if (att instanceof GeometryDescriptor) {
           sql.append(columnName + "_x,");
           sql.append(columnName + "_y");
        } else {
            sql.append(columnName);
        }

        sql.append(",");
    }
}
 
开发者ID:DennisPallett,项目名称:gt-jdbc-monetdb-simple,代码行数:18,代码来源:SimpleMonetDBFeatureSource.java

示例3: initializePositionMaps

import org.opengis.feature.type.AttributeDescriptor; //导入方法依赖的package包/类
private void initializePositionMaps() {
	try {
		for (int i = 0; i < reprojectedFeatureType.getAttributeCount(); i++) {
			final AttributeDescriptor ad = reprojectedFeatureType.getDescriptor(i);
			final ByteArrayId currFieldId = new ByteArrayId(
					ad.getLocalName());
			fieldToPositionMap.forcePut(
					currFieldId,
					i);
		}
		positionToFieldMap = fieldToPositionMap.inverse();
	}
	catch (final Exception e) {
		LOGGER.error(
				"Unable to initialize position map, continuing anyways",
				e);
	}
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:19,代码来源:FeatureDataAdapter.java

示例4: configureFromType

import org.opengis.feature.type.AttributeDescriptor; //导入方法依赖的package包/类
/**
 * {@inheritDoc} Configure this VisibilityConfiguration object based on the
 * passed in SimpleFeatureType. This includes setting the 'attributeName' to
 * the attribute that has a key of 'visiblity'.
 * 
 * @param persistType
 *            - object used to configure this VisibilityConfiguration object
 * 
 */
@Override
public void configureFromType(
		final SimpleFeatureType persistType ) {
	// Search the list of attributes for one that has user data
	// with a key of 'visibility' and that the value of
	// it is Boolean.TRUE. If found, set this object's attributeName to
	// the found attribute.

	for (final AttributeDescriptor attrDesc : persistType.getAttributeDescriptors()) {
		if (attrDesc.getUserData().containsKey(
				"visibility") && Boolean.TRUE.equals(attrDesc.getUserData().get(
				"visibility"))) {
			attributeName = attrDesc.getLocalName();
		}
	}
	configureManager(persistType);
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:27,代码来源:VisibilityConfiguration.java

示例5: openInputShapefile

import org.opengis.feature.type.AttributeDescriptor; //导入方法依赖的package包/类
/**
 * Open the input shape file and load it into memory.
 */
public void openInputShapefile(String inputShapefile) throws IOException {
  File file = new File(inputShapefile);

  ShapefileDataStoreFactory dataStoreFactory = new ShapefileDataStoreFactory();
  Map<String, Serializable> params = new HashMap<>();
  params.put(ShapefileDataStoreFactory.URLP.key, file.toURI().toURL());
  params.put(ShapefileDataStoreFactory.CREATE_SPATIAL_INDEX.key, Boolean.TRUE);
  params.put(ShapefileDataStoreFactory.ENABLE_SPATIAL_INDEX.key, Boolean.TRUE);
  params.put(ShapefileDataStoreFactory.MEMORY_MAPPED.key, Boolean.TRUE);
  params.put(ShapefileDataStoreFactory.CACHE_MEMORY_MAPS.key, Boolean.TRUE);

  ShapefileDataStore store = (ShapefileDataStore) dataStoreFactory.createNewDataStore(params);
  featureSource = store.getFeatureSource();
  // determine the correct case of the tz attribute because its case has been
  // changed from efele to evansiroky
  SimpleFeatureType schema = featureSource.getSchema();
  List<AttributeDescriptor> attributeDescriptorList = schema.getAttributeDescriptors();
  for (AttributeDescriptor attributeDescriptor : attributeDescriptorList) {
    if ("tzid".equalsIgnoreCase(attributeDescriptor.getLocalName())) {
      tzidAttr = attributeDescriptor.getLocalName();
    }
  }

  filterFactory = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
  geometryFactory = JTSFactoryFinder.getGeometryFactory();
}
 
开发者ID:skaringa,项目名称:tzdataservice,代码行数:30,代码来源:TzDataShpFileReadAndLocate.java

示例6: resolveName

import org.opengis.feature.type.AttributeDescriptor; //导入方法依赖的package包/类
private String resolveName(String name) {
	for (AttributeDescriptor descriptor : this.featureType
			.getAttributeDescriptors()) {
		if (descriptor.getLocalName().equalsIgnoreCase(name))
			return descriptor.getLocalName();
	}
	return name;
}
 
开发者ID:joaomartins27396,项目名称:GSOC2015-gsmonitoext,代码行数:9,代码来源:FeatureMonitorDAO.java

示例7: visit

import org.opengis.feature.type.AttributeDescriptor; //导入方法依赖的package包/类
/**
 * Writes the FilterBuilder for the attribute Expression.
 * 
 * @param expression the attribute.
 *
 */
@Override
public Object visit(PropertyName expression, Object extraData) {
    LOGGER.finest("exporting PropertyName");

    SimpleFeatureType featureType = this.featureType;

    Class target = null;
    if(extraData instanceof Class) {
        target = (Class) extraData;
    }

    //first evaluate expression against feature type get the attribute, 
    AttributeDescriptor attType = (AttributeDescriptor) expression.evaluate(featureType);

    String encodedField; 
    if ( attType != null ) {
        encodedField = attType.getLocalName();
        if(target != null && target.isAssignableFrom(attType.getType().getBinding())) {
            // no need for casting, it's already the right type
            target = null;
        }
    } else {
        // fall back to just encoding the property name
        encodedField = expression.getPropertyName();
    }

    if (target != null) {
        LOGGER.fine("PropertyName type casting not implemented");
    }
    field = encodedField;

    return extraData;
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:40,代码来源:FilterToElastic.java

示例8: findAttributeName

import org.opengis.feature.type.AttributeDescriptor; //导入方法依赖的package包/类
/**
 * Find the name of an attribute, case insensitive.
 * 
 * @param featureType the feature type to check.
 * @param field the case insensitive field name.
 * @return the real name of the field, or <code>null</code>, if none found.
 */
public static String findAttributeName( SimpleFeatureType featureType, String field ) {
    List<AttributeDescriptor> attributeDescriptors = featureType.getAttributeDescriptors();
    for( AttributeDescriptor attributeDescriptor : attributeDescriptors ) {
        String name = attributeDescriptor.getLocalName();
        if (name.toLowerCase().equals(field.toLowerCase())) {
            return name;
        }
    }
    return null;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:18,代码来源:FeatureUtilities.java

示例9: getAttributesNames

import org.opengis.feature.type.AttributeDescriptor; //导入方法依赖的package包/类
/**
 * Getter for the list of attribute names.
 * 
 * @return the list of attribute names.
 */
public List<String> getAttributesNames() {
    SimpleFeatureType featureType = feature.getFeatureType();
    List<AttributeDescriptor> attributeDescriptors = featureType.getAttributeDescriptors();

    List<String> attributeNames = new ArrayList<String>();
    for( AttributeDescriptor attributeDescriptor : attributeDescriptors ) {
        String name = attributeDescriptor.getLocalName();
        attributeNames.add(name);
    }
    return attributeNames;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:17,代码来源:FeatureMate.java

示例10: getAttributeIndex

import org.opengis.feature.type.AttributeDescriptor; //导入方法依赖的package包/类
private int getAttributeIndex(VectorDataNode pointDataSource, AttributeDescriptor dataField) {
    final String fieldName = dataField.getLocalName();
    if (fieldName.equals(CorrelativeFieldSelector.NULL_NAME)) {
        return -1;
    }
    return pointDataSource.getFeatureType().indexOf(fieldName);
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:8,代码来源:ProfilePlotPanel.java

示例11: buildFeatureDefinition

import org.opengis.feature.type.AttributeDescriptor; //导入方法依赖的package包/类
/**
 * Add the attributes, types and classifications for the SimpleFeatureType
 * to the provided FeatureDefinition
 *
 * @param fd
 *            - existing Feature Definition (or new one if null)
 * @param sft
 *            - SimpleFeatureType of the simpleFeature being serialized
 * @param defaultClassifications
 *            - map of attribute names to classification
 * @param defaultClassification
 *            - default classification if one could not be found in the map
 * @return
 * @throws IOException
 */
public static FeatureDefinition buildFeatureDefinition(
		FeatureDefinition fd,
		final SimpleFeatureType sft,
		final Map<String, String> defaultClassifications,
		final String defaultClassification )
		throws IOException {
	if (fd == null) {
		fd = new FeatureDefinition();
	}
	fd.setFeatureTypeName(sft.getTypeName());

	final List<String> attributes = new ArrayList<>(
			sft.getAttributeCount());
	final List<String> types = new ArrayList<>(
			sft.getAttributeCount());
	final List<String> classifications = new ArrayList<>(
			sft.getAttributeCount());

	for (final AttributeDescriptor attr : sft.getAttributeDescriptors()) {
		final String localName = attr.getLocalName();

		attributes.add(localName);
		types.add(attr.getType().getBinding().getCanonicalName());
		classifications.add(getClassification(
				localName,
				defaultClassifications,
				defaultClassification));
	}

	fd.setAttributeNames(attributes);
	fd.setAttributeTypes(types);
	fd.setAttributeDefaultClassifications(classifications);

	return fd;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:51,代码来源:AvroFeatureUtils.java

示例12: getTimeField

import org.opengis.feature.type.AttributeDescriptor; //导入方法依赖的package包/类
public static String getTimeField(
		final DataStorePluginOptions dataStore,
		final ByteArrayId adapterId ) {
	final AdapterStore adapterStore = dataStore.createAdapterStore();

	final DataAdapter adapter = adapterStore.getAdapter(adapterId);

	if ((adapter != null) && (adapter instanceof GeotoolsFeatureDataAdapter)) {
		final GeotoolsFeatureDataAdapter gtAdapter = (GeotoolsFeatureDataAdapter) adapter;
		final SimpleFeatureType featureType = gtAdapter.getFeatureType();
		final TimeDescriptors timeDescriptors = gtAdapter.getTimeDescriptors();

		// If not indexed, try to find a time field
		if ((timeDescriptors == null) || !timeDescriptors.hasTime()) {
			for (final AttributeDescriptor attrDesc : featureType.getAttributeDescriptors()) {
				final Class<?> bindingClass = attrDesc.getType().getBinding();
				if (TimeUtils.isTemporal(bindingClass)) {
					return attrDesc.getLocalName();
				}
			}
		}
		else {
			if (timeDescriptors.getTime() != null) {
				return timeDescriptors.getTime().getLocalName();
			}
			else if (timeDescriptors.getStartRange() != null) {
				// give back start|stop string
				return timeDescriptors.getStartRange().getLocalName() + "|"
						+ timeDescriptors.getEndRange().getLocalName();
			}
		}
	}

	return null;
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:36,代码来源:FeatureDataUtils.java

示例13: writeScene

import org.opengis.feature.type.AttributeDescriptor; //导入方法依赖的package包/类
public static void writeScene(
		final SimpleFeatureType sceneType,
		final SimpleFeature firstBandOfScene,
		final IndexWriter sceneWriter ) {
	final SimpleFeatureBuilder bldr = new SimpleFeatureBuilder(
			sceneType);
	String fid = null;
	for (int i = 0; i < sceneType.getAttributeCount(); i++) {
		final AttributeDescriptor attr = sceneType.getDescriptor(i);
		final String attrName = attr.getLocalName();
		final Object attrValue = firstBandOfScene.getAttribute(attrName);
		if (attrValue != null) {
			bldr.set(
					i,
					attrValue);
			if (attrName.equals(SceneFeatureIterator.ENTITY_ID_ATTRIBUTE_NAME)) {
				fid = attrValue.toString();
			}
		}
	}
	if (fid != null) {
		try {
			sceneWriter.write(bldr.buildFeature(fid));
		}
		catch (IOException e) {
			LOGGER.error(
					"Unable to write scene",
					e);
		}
	}
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:32,代码来源:VectorIngestRunner.java

示例14: createDescriptor

import org.opengis.feature.type.AttributeDescriptor; //导入方法依赖的package包/类
private org.geomajas.gwt2.client.map.attribute.AttributeDescriptor createDescriptor(
		AttributeDescriptor attributeDescriptor) {
	Class<?> binding = attributeDescriptor.getType().getBinding();
	String name = attributeDescriptor.getLocalName();
	AttributeDescriptorImpl attributeInfo;
	if (Integer.class.equals(binding)) {
		attributeInfo = new AttributeDescriptorImpl(new PrimitiveAttributeTypeImpl(PrimitiveType.INTEGER), name);
	} else if (Float.class.equals(binding)) {
		attributeInfo = new AttributeDescriptorImpl(new PrimitiveAttributeTypeImpl(PrimitiveType.FLOAT), name);
	} else if (Double.class.equals(binding)) {
		attributeInfo = new AttributeDescriptorImpl(new PrimitiveAttributeTypeImpl(PrimitiveType.DOUBLE), name);
	} else if (BigDecimal.class.equals(binding)) {
		attributeInfo = new AttributeDescriptorImpl(new PrimitiveAttributeTypeImpl(PrimitiveType.DOUBLE), name);
	} else if (Boolean.class.equals(binding)) {
		attributeInfo = new AttributeDescriptorImpl(new PrimitiveAttributeTypeImpl(PrimitiveType.BOOLEAN), name);
	} else if (Date.class.equals(binding)) {
		attributeInfo = new AttributeDescriptorImpl(new PrimitiveAttributeTypeImpl(PrimitiveType.DATE), name);
	} else if (Point.class.equals(binding)) {
		attributeInfo = new AttributeDescriptorImpl(new GeometryAttributeTypeImpl(GeometryType.POINT), name);
	} else if (LineString.class.equals(binding)) {
		attributeInfo = new AttributeDescriptorImpl(new GeometryAttributeTypeImpl(GeometryType.LINESTRING), name);
	} else if (LinearRing.class.equals(binding)) {
		attributeInfo = new AttributeDescriptorImpl(new GeometryAttributeTypeImpl(GeometryType.LINEARRING), name);
	} else if (Polygon.class.equals(binding)) {
		attributeInfo = new AttributeDescriptorImpl(new GeometryAttributeTypeImpl(GeometryType.POLYGON), name);
	} else if (MultiPoint.class.equals(binding)) {
		attributeInfo = new AttributeDescriptorImpl(new GeometryAttributeTypeImpl(GeometryType.MULTIPOINT), name);
	} else if (MultiLineString.class.equals(binding)) {
		attributeInfo = new AttributeDescriptorImpl(new GeometryAttributeTypeImpl(GeometryType.MULTILINESTRING),
				name);
	} else if (MultiPolygon.class.equals(binding)) {
		attributeInfo = new AttributeDescriptorImpl(new GeometryAttributeTypeImpl(GeometryType.MULTIPOLYGON), name);
	} else {
		attributeInfo = new AttributeDescriptorImpl(new PrimitiveAttributeTypeImpl(PrimitiveType.STRING), name);
	}
	return attributeInfo;
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:38,代码来源:WfsDescribeFeatureTypeCommand.java

示例15: getAttributeName

import org.opengis.feature.type.AttributeDescriptor; //导入方法依赖的package包/类
/**
 * Returns the attribute name of the database attribute which corresponds to the shapefile attribute
 * 
 * @param descriptor
 * @return
 */
public String getAttributeName(AttributeDescriptor descriptor)
{
  String key = descriptor.getLocalName();

  if (this.attributeMapping.containsKey(key))
  {
    return this.attributeMapping.get(key);
  }

  return null;
}
 
开发者ID:terraframe,项目名称:geoprism,代码行数:18,代码来源:ShapefileImportConfiguration.java


注:本文中的org.opengis.feature.type.AttributeDescriptor.getLocalName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。