• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PropertyDescriptor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.opengis.feature.type.PropertyDescriptor的典型用法代码示例。如果您正苦于以下问题:Java PropertyDescriptor类的具体用法?Java PropertyDescriptor怎么用?Java PropertyDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PropertyDescriptor类属于org.opengis.feature.type包,在下文中一共展示了PropertyDescriptor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: testConnectToInlineDataSource

import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
/**
 * Test method for {@link com.sldeditor.datasource.impl.DataSourceImpl#connect()}.
 */
@Test
public void testConnectToInlineDataSource() {
    DataSourceImpl ds = new DataSourceImpl();

    DummyInlineSLDFile editorFile = new DummyInlineSLDFile();
    DummyDataSourceUpdate dataSourceUpdateListener = new DummyDataSourceUpdate();
    ds.addListener(dataSourceUpdateListener);

    CreateDataSourceInterface internalDataSource = new DummyCreateDataSource();
    CreateDataSourceInterface externalDataSource = new DummyCreateDataSource();
    CreateDataSourceInterface inlineDataSource = new CreateInlineDataSource();

    ds.setDataSourceCreation(internalDataSource, externalDataSource, inlineDataSource);
    ds.connect("typeName", editorFile, null);
    assertTrue(dataSourceUpdateListener.hasBeenCalled());

    assertEquals(GeometryTypeEnum.UNKNOWN, dataSourceUpdateListener.geometryType);
    assertFalse(dataSourceUpdateListener.isConnectedToDataSourceFlag);

    Collection<PropertyDescriptor> fieldList = ds.getPropertyDescriptorList();
    assertNull(fieldList);

    FeatureSource<SimpleFeatureType, SimpleFeature> exampleLayer = ds.getExampleFeatureSource();
    assertNull(exampleLayer);

    Map<UserLayer, FeatureSource<SimpleFeatureType, SimpleFeature>> userLayerMap = ds
            .getUserLayerFeatureSource();
    assertEquals(1, userLayerMap.size());

    assertFalse(dataSourceUpdateListener.hasBeenCalled());

    ds.updateUserLayers();
    assertTrue(dataSourceUpdateListener.hasBeenCalled());

    DataSourcePropertiesInterface dsi = ds.getDataConnectorProperties();
    assertNotNull(dsi);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:41,代码来源:DataSourceImplTest.java


示例17: testGetPropertyDescriptorList

import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.datasource.impl.DataSourceInfo#getPropertyDescriptorList()}.
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void testGetPropertyDescriptorList() {
    URL url = SLDEditorFile.class.getClassLoader()
            .getResource("point/sld/shp/sld_cookbook_point.shp");

    Map map = new HashMap();
    map.put("url", url);
    DataStore dataStore;
    try {
        dataStore = DataStoreFinder.getDataStore(map);

        DataSourceInfo dsInfo = new DataSourceInfo();

        String typeName = dataStore.getTypeNames()[0];
        dsInfo.setTypeName(typeName);
        SimpleFeatureSource source = dataStore.getFeatureSource(typeName);
        SimpleFeatureType schema = source.getSchema();

        assertNull(dsInfo.getPropertyDescriptorList());
        dsInfo.setSchema(schema);

        Collection<PropertyDescriptor> fieldList = dsInfo.getPropertyDescriptorList();

        assertTrue(fieldList.size() == 3);
    } catch (IOException e) {
        e.printStackTrace();
        fail(e.getMessage());
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:35,代码来源:DataSourceInfoTest.java


示例18: saveAsCSV

import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
@Override
public void saveAsCSV() {
	final List<String> attributes = new ArrayList<String>();
	for (final PropertyDescriptor v : layer.getFeatureSource().getSchema().getDescriptors()) {
		attributes.add(v.getName().toString());
	}
	saveAsCSV(attributes, null, null);
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:9,代码来源:ShapeFileViewer.java


示例19: isGridLayer

import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
/**
 * Check if the given map layer contains a grid coverage or a grid coverage reader.
 * <p>
 * Implementation note: we avoid referencing org.geotools.coverage.grid classes directly here so that applications
 * dealing only with other data types are not forced to have JAI in the classpath.
 *
 * @param layer
 *            the map layer
 *
 * @return true if this is a grid layer; false otherwise
 */
public static boolean isGridLayer(final Layer layer) {

	final Collection<PropertyDescriptor> descriptors = layer.getFeatureSource().getSchema().getDescriptors();
	for (final PropertyDescriptor desc : descriptors) {
		final Class<?> binding = desc.getType().getBinding();

		if (BASE_GRID_CLASS.isAssignableFrom(binding)
				|| BASE_READER_CLASS.isAssignableFrom(binding)) { return true; }
	}

	return false;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:24,代码来源:Utils.java


示例20: getGridAttributeName

import org.opengis.feature.type.PropertyDescriptor; //导入依赖的package包/类
public static String getGridAttributeName(final Layer layer) {
	String attrName = null;

	final Collection<PropertyDescriptor> descriptors = layer.getFeatureSource().getSchema().getDescriptors();
	for (final PropertyDescriptor desc : descriptors) {
		final Class<?> binding = desc.getType().getBinding();

		if (BASE_GRID_CLASS.isAssignableFrom(binding) || BASE_READER_CLASS.isAssignableFrom(binding)) {
			attrName = desc.getName().getLocalPart();
			break;
		}
	}

	return attrName;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:16,代码来源:Utils.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AvroParquetOutputFormat类代码示例发布时间:2022-05-22
下一篇:
Java DateCell类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap