本文整理汇总了Java中org.opengis.feature.type.PropertyDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java PropertyDescriptor类的具体用法?Java PropertyDescriptor怎么用?Java PropertyDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyDescriptor类属于org.opengis.feature.type包,在下文中一共展示了PropertyDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populateFieldMap
import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
/**
* Populate field map for the data source.
*/
private void populateFieldMap() {
if(dataSourceInfo != null)
{
geometryFieldName = dataSourceInfo.getGeometryFieldName();
fieldNameMap.clear();
fieldTypeMap.clear();
logger.debug("Datasource fields:");
int index = 0;
Collection<PropertyDescriptor> descriptorList = dataSourceInfo.getPropertyDescriptorList();
if(descriptorList != null)
{
for(PropertyDescriptor property : descriptorList)
{
logger.debug(String.format(" %-20s %s", property.getName(), property.getType().getBinding().getName()));
fieldNameMap.put(index, property.getName());
fieldTypeMap.put(index, property.getType().getBinding());
index ++;
}
}
}
}
示例2: getAttributes
import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
/**
* Gets the attributes.
*
* @param expectedDataType the expected data type
* @return the attributes
*/
/* (non-Javadoc)
* @see com.sldeditor.datasource.impl.DataSourceInterface#getAttributes(java.lang.Class)
*/
@Override
public List<String> getAttributes(Class<?> expectedDataType) {
List<String> attributeNameList = new ArrayList<String>();
Collection<PropertyDescriptor> descriptorList = getPropertyDescriptorList();
if(descriptorList != null)
{
for(PropertyDescriptor property : descriptorList)
{
Class<?> bindingType = property.getType().getBinding();
if(AllowedAttributeTypes.isAllowed(bindingType, expectedDataType))
{
attributeNameList.add(property.getName().toString());
}
}
}
return attributeNameList;
}
示例3: populateFieldMap
import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
/**
* Populate field map for the data source.
*/
public void populateFieldMap() {
fieldNameMap.clear();
fieldTypeMap.clear();
logger.debug("Datasource fields:");
int index = 0;
Collection<PropertyDescriptor> descriptorList = getPropertyDescriptorList();
if (descriptorList != null) {
for (PropertyDescriptor property : descriptorList) {
if (property != null) {
logger.debug(String.format(" %-20s %s", property.getName(),
property.getType().getBinding().getName()));
fieldNameMap.put(index, property.getName());
fieldTypeMap.put(index, property.getType().getBinding());
}
index++;
}
}
}
示例4: getAttributes
import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
/**
* Gets the attributes.
*
* @param expectedDataType the expected data type
* @return the attributes
*/
/*
* (non-Javadoc)
*
* @see com.sldeditor.datasource.impl.DataSourceInterface#getAttributes(java.lang.Class)
*/
@Override
public List<String> getAttributes(Class<?> expectedDataType) {
List<String> attributeNameList = new ArrayList<String>();
Collection<PropertyDescriptor> descriptorList = getPropertyDescriptorList();
if (descriptorList != null) {
for (PropertyDescriptor property : descriptorList) {
Class<?> bindingType = property.getType().getBinding();
if (AllowedAttributeTypes.isAllowed(bindingType, expectedDataType)) {
attributeNameList.add(property.getName().toString());
}
}
}
return attributeNameList;
}
示例5: getAllAttributes
import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
@Override
public List<String> getAllAttributes(boolean includeGeometry) {
List<String> attributeNameList = new ArrayList<String>();
Collection<PropertyDescriptor> descriptorList = getPropertyDescriptorList();
if (descriptorList != null) {
for (PropertyDescriptor property : descriptorList) {
boolean isGeometry = (property instanceof GeometryDescriptor);
if ((isGeometry && includeGeometry) || !isGeometry) {
attributeNameList.add(property.getName().toString());
}
}
}
return attributeNameList;
}
示例6: ComplexTypeImpl
import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
public ComplexTypeImpl(
Name name, Collection<PropertyDescriptor> properties, boolean identified,
boolean isAbstract, List<Filter> restrictions, AttributeType superType,
InternationalString description
) {
super(name, Collection.class, identified, isAbstract, restrictions, superType, description);
List<PropertyDescriptor> localProperties;
Map<Name, PropertyDescriptor> localPropertyMap;
if (properties == null) {
localProperties = Collections.emptyList();
localPropertyMap = Collections.emptyMap();
} else {
localProperties = new ArrayList<PropertyDescriptor>(properties);
localPropertyMap = new HashMap<Name, PropertyDescriptor>();
for (PropertyDescriptor pd : properties) {
if( pd == null ){
// descriptor entry may be null if a request was made for a property that does not exist
throw new NullPointerException("PropertyDescriptor is null - did you request a property that does not exist?");
}
localPropertyMap.put(pd.getName(), pd);
}
}
this.properties = Collections.unmodifiableList(localProperties);
this.propertyMap = Collections.unmodifiableMap(localPropertyMap);
}
示例7: getDescriptor
import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
public PropertyDescriptor getDescriptor(String name) {
PropertyDescriptor result = getDescriptor(new NameImpl(name));
if (result == null) {
// look in the same namespace as the complex type
result = getDescriptor(new NameImpl(getName().getNamespaceURI(), name));
if (result == null) {
// full scan
for (PropertyDescriptor pd : properties) {
if (pd.getName().getLocalPart().equals(name)) {
return pd;
}
}
}
}
return result;
}
示例8: createSchema
import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
private static String[] createSchema(Collection<PropertyDescriptor> attributeTypes) {
String[] out = new String[attributeTypes.size()];
int i = 0;
for (PropertyDescriptor at : attributeTypes) {
out[i++] = at.getName().toString();
}
return out;
}
示例9: createTypes
import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
private static String[] createTypes(Collection<PropertyDescriptor> attributeTypes) {
String[] out = new String[attributeTypes.size()];
int i = 0;
for (PropertyDescriptor at : attributeTypes) {
out[i++] = at.getType().getName().toString();
}
return out;
}
示例10: mergeShapeFile2
import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
/**
*
* @param collectionsLayer
* @param shpInput
* @param transform
* @param bbox
* @return
* @throws Exception
*/
public static GeometryImage mergeShapeFile2(SimpleFeatureCollection collectionsLayer, File shpInput,GeoTransform transform,Polygon bbox)throws Exception {
Map<String, Serializable> params = new HashMap<String, Serializable>();
params.put("url", shpInput.toURI().toURL());
//create a DataStore object to connect to the physical source
DataStore dataStore = DataStoreFinder.getDataStore(params);
//retrieve a FeatureSource to work with the feature data
SimpleFeatureSource shape2 = (SimpleFeatureSource) dataStore.getFeatureSource(dataStore.getTypeNames()[0]);
ClipProcess clip=new ClipProcess();
SimpleFeatureCollection collectionsShape2=shape2.getFeatures();
SimpleFeatureCollection fc=clip.execute(collectionsShape2, bbox,true);
SimpleFeatureSource source = new CollectionFeatureSource(fc);
SimpleFeatureCollection result=joinFeaures(source, shape2);
//create new datastore to save the new shapefile
FileDataStoreFactorySpi factory = new ShapefileDataStoreFactory();
File tmp=new File(SumoPlatform.getApplication().getCachePath()+"\\tmpshape_"+System.currentTimeMillis()+".shp");
Map<String, Serializable> params2 = new HashMap<String, Serializable>();
params2.put("url", tmp.toURI().toURL());
ShapefileDataStore newds=(ShapefileDataStore)factory.createNewDataStore(params2);
String geoName = collectionsLayer.getSchema().getGeometryDescriptor().getType().getName().toString();
//String nameOutput="merge_"+shpInput.getName()+"_"+LayerManager.getIstanceManager().getCurrentImageLayer().getName();
//from here create the new GeometricLayer
Collection<PropertyDescriptor>descriptorsMerge=new ArrayList<>();
descriptorsMerge.addAll(shape2.getSchema().getDescriptors());
descriptorsMerge.addAll(collectionsLayer.getSchema().getDescriptors());
String[] schema = createSchema(descriptorsMerge);
String[] types = createTypes(descriptorsMerge);
GeometryImage out=GeometryImage.createLayerFromFeatures(geoName, newds, result, schema, types,true,transform);
return out;
}
示例11: createTypes
import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
private static String[] createTypes(Collection<PropertyDescriptor> attributeTypes) {
String[] out = new String[attributeTypes.size()];
int i = 0;
for (PropertyDescriptor at : attributeTypes) {
out[i++] = at.getType().getBinding().getName();
}
return out;
}
示例12: getPropertyDescriptorList
import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
/**
* Gets the property descriptor list.
*
* @return the property descriptor list
*/
public Collection<PropertyDescriptor> getPropertyDescriptorList() {
if(schema != null)
{
return schema.getDescriptors();
}
return null;
}
示例13: getPropertyDescriptorList
import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
/**
* Gets the property descriptor list.
*
* @return the property descriptor list
*/
@Override
public Collection<PropertyDescriptor> getPropertyDescriptorList() {
if(dataSourceInfo != null)
{
return dataSourceInfo.getPropertyDescriptorList();
}
return null;
}
示例14: getPropertyDescriptorList
import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
/**
* Gets the property descriptor list.
*
* @return the property descriptor list
*/
public Collection<PropertyDescriptor> getPropertyDescriptorList() {
if (schema != null) {
return schema.getDescriptors();
} else {
if (geometryType == GeometryTypeEnum.RASTER) {
if (rasterPropertyDescriptorList == null) {
rasterPropertyDescriptorList = new ArrayList<PropertyDescriptor>();
CoordinateReferenceSystem crs = null;
boolean isIdentifiable = false;
boolean isAbstract = false;
List<Filter> restrictions = null;
AttributeType superType = null;
InternationalString description = null;
GeometryType type = featureTypeFactory.createGeometryType(
new NameImpl(rasterGeometryField), GridCoverage2D.class, crs,
isIdentifiable, isAbstract, restrictions, superType, description);
GeometryDescriptor descriptor = featureTypeFactory.createGeometryDescriptor(
type, new NameImpl(rasterGeometryField), 0, 1, false, null);
rasterPropertyDescriptorList.add(descriptor);
}
return rasterPropertyDescriptorList;
}
}
return null;
}
示例15: getPropertyDescriptorList
import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
/**
* Gets the property descriptor list.
*
* @return the property descriptor list
*/
@Override
public Collection<PropertyDescriptor> getPropertyDescriptorList() {
if (dataSourceInfo != null) {
return dataSourceInfo.getPropertyDescriptorList();
}
return null;
}