本文整理汇总了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
}
示例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);
}
示例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
}
示例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
}