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


Java FeatureTypeFactoryImpl类代码示例

本文整理汇总了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;
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:32,代码来源:DefaultWfsDataStoreFactory.java


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