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


Java DataUtilities.simple方法代码示例

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


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

示例1: rawSchemaExample

import org.geotools.data.DataUtilities; //导入方法依赖的package包/类
private void rawSchemaExample() throws Exception {
    Name typeName = null;
    URL schemaLocation = null;
    CoordinateReferenceSystem crs = null;
    // rawSchemaExample start
    
    // assume we are working from WFS 1.1 / GML3 / etc...    
    final QName featureName = new QName(typeName.getNamespaceURI(), typeName.getLocalPart());

    String namespaceURI = featureName.getNamespaceURI();
    String uri = schemaLocation.toExternalForm();
    
    Configuration wfsConfiguration = new org.geotools.gml3.ApplicationSchemaConfiguration(
            namespaceURI, uri);

    FeatureType parsed = GTXML.parseFeatureType(wfsConfiguration, featureName, crs);
    // safely cast down to SimpleFeatureType
    SimpleFeatureType schema = DataUtilities.simple(parsed);
    // rawSchemaExample end
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:21,代码来源:GMLExamples.java

示例2: addFeatures

import org.geotools.data.DataUtilities; //导入方法依赖的package包/类
/**
 * see interface for details.
 * @param fc
 *
 * @throws IOException
 */
public List<FeatureId> addFeatures(FeatureCollection<SimpleFeatureType, SimpleFeature> fc) throws IOException {
    FeatureStore<SimpleFeatureType, SimpleFeature> store = store();

    //check if the feature collection needs to be retyped
    if (!store.getSchema().equals(fc.getSchema())) {
        fc = new RetypingFeatureCollection(DataUtilities.simple(fc), store.getSchema());
    }

    return store().addFeatures(fc);
}
 
开发者ID:STEMLab,项目名称:geoserver-3d-extension,代码行数:17,代码来源:GeoServerFeatureStore.java

示例3: exampleDataUtilities

import org.geotools.data.DataUtilities; //导入方法依赖的package包/类
void exampleDataUtilities() throws Exception {
    FeatureCollection<SimpleFeatureType, SimpleFeature> collection = null;
    
    // exampleDataUtilities start
    SimpleFeatureCollection features = DataUtilities.simple(collection);
    // exampleDataUtilities end
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:8,代码来源:MainExamples.java

示例4: rawSchemaExample2

import org.geotools.data.DataUtilities; //导入方法依赖的package包/类
private void rawSchemaExample2() throws Exception {
    Name typeName = null;
    URL schemaLocation = null;
    CoordinateReferenceSystem crs = null;
    // rawSchemaExample2 start
    
    // more involved example showing a custom Configuration
    final QName featureName = new QName(typeName.getNamespaceURI(), typeName.getLocalPart());

    String namespaceURI = featureName.getNamespaceURI();
    String uri = schemaLocation.toExternalForm();
    
    // Step 1: Parse schema using XSD 
    XSD xsd = new org.geotools.gml2.ApplicationSchemaXSD(namespaceURI, uri);
    
    // Step 2: custom configuration
    Configuration configuration = new Configuration(xsd) {
        {
            addDependency(new XSConfiguration());
            addDependency(new org.geotools.gml2.GMLConfiguration());
        }
        protected void registerBindings(java.util.Map bindings) {
            // we have no special bindings
        }
    };
    FeatureType parsed = GTXML.parseFeatureType(configuration, featureName, crs);
    // safely cast down to SimpleFeatureType
    SimpleFeatureType schema = DataUtilities.simple(parsed);
    // rawSchemaExample2 end
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:31,代码来源:GMLExamples.java


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