本文整理汇总了Java中org.geotools.feature.type.FeatureTypeFactoryImpl类的典型用法代码示例。如果您正苦于以下问题:Java FeatureTypeFactoryImpl类的具体用法?Java FeatureTypeFactoryImpl怎么用?Java FeatureTypeFactoryImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FeatureTypeFactoryImpl类属于org.geotools.feature.type包,在下文中一共展示了FeatureTypeFactoryImpl类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDataStore
import org.geotools.feature.type.FeatureTypeFactoryImpl; //导入依赖的package包/类
@Override
public WFSDataStore createDataStore(Map<String, Serializable> params, HTTPClient http) throws IOException {
final WFSConfig config = WFSConfig.fromParams(params);
String user = config.getUser();
String password = config.getPassword();
if (((user == null) && (password != null)) || ((config.getPassword() == null) && (config.getUser() != null))) {
throw new IOException("Cannot define only one of USERNAME or PASSWORD, must define both or neither");
}
final URL capabilitiesURL = (URL) WFSDataStoreFactory.URL.lookUp(params);
http.setUser(config.getUser());
http.setPassword(config.getPassword());
int timeoutMillis = config.getTimeoutMillis();
http.setConnectTimeout(timeoutMillis / 1000);
// WFSClient performs version negotiation and selects the correct strategy
WFSClient wfsClient;
try {
wfsClient = new WFSClient(capabilitiesURL, http, new WfsConfigAxisOrder(config));
} catch (ServiceException e) {
throw new IOException(e);
}
WFSDataStore dataStore = new WFSDataStore(wfsClient);
// factories
dataStore.setFilterFactory(CommonFactoryFinder.getFilterFactory(null));
dataStore.setGeometryFactory(new GeometryFactory(PackedCoordinateSequenceFactory.DOUBLE_FACTORY));
dataStore.setFeatureTypeFactory(new FeatureTypeFactoryImpl());
dataStore.setFeatureFactory(CommonFactoryFinder.getFeatureFactory(null));
dataStore.setNamespaceURI(config.getNamespaceOverride());
return dataStore;
}