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


Java PropertyDescriptor类代码示例

本文整理汇总了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 ++;
            }
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:27,代码来源:DataSourceImpl.java

示例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;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:29,代码来源:DataSourceImpl.java

示例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++;
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:23,代码来源:DataSourceInfo.java

示例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;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:28,代码来源:DataSourceImpl.java

示例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;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:17,代码来源:DataSourceImpl.java

示例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);
   }
 
开发者ID:opengeospatial,项目名称:Java-OpenMobility,代码行数:27,代码来源:ComplexTypeImpl.java

示例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;
}
 
开发者ID:opengeospatial,项目名称:Java-OpenMobility,代码行数:17,代码来源:ComplexTypeImpl.java

示例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;
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:9,代码来源:PostgisIO.java

示例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;
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:9,代码来源:PostgisIO.java

示例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;
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:48,代码来源:SimpleShapefile.java

示例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;
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:9,代码来源:SimpleShapefile.java

示例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;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:13,代码来源:DataSourceInfo.java

示例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;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:14,代码来源:DataSourceImpl.java

示例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;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:34,代码来源:DataSourceInfo.java

示例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;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:13,代码来源:DataSourceImpl.java


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