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


Java ServiceException类代码示例

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


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

示例1: getCapabiltiesURL

import org.geotools.ows.ServiceException; //导入依赖的package包/类
/**
 * gets the getCapabilities URL.
 * @param mapURL the URL of the Map
 * @return getCapabilties URL
 */
public static URL getCapabiltiesURL(URL mapURL) {
    URL url = mapURL;
    try {
        WebMapServer wms = new WebMapServer(mapURL);
        HTTPClient httpClient = wms.getHTTPClient();
        URL get = wms.
                getCapabilities().
                getRequest().
                getGetCapabilities().
                getGet();
        if (get != null) {
            url = new URL(get.toString() + "request=GetCapabilities");
        }
        httpClient.getConnectTimeout();
    } catch (IOException | ServiceException e) {
        log.log(Level.SEVERE, e.getMessage(), e);
    }
    return url;
}
 
开发者ID:gdi-by,项目名称:downloadclient,代码行数:25,代码来源:WMSMapSwing.java

示例2: downloadWmsImage

import org.geotools.ows.ServiceException; //导入依赖的package包/类
private static BufferedImage downloadWmsImage(GetMapRequest mapRequest, WebMapServer wms) throws IOException,
        ServiceException {
    GetMapResponse mapResponse = wms.issueRequest(mapRequest);
    try (InputStream inputStream = mapResponse.getInputStream()) {
        return ImageIO.read(inputStream);
    }
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:8,代码来源:WmsLayerType.java

示例3: createDataStore

import org.geotools.ows.ServiceException; //导入依赖的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

示例4: WMSMapSwing

import org.geotools.ows.ServiceException; //导入依赖的package包/类
/**
 * Constructor.
 * @param mapURL mapURL
 * @param width width
 * @param heigth heigth
 * @param layer layer
 * @param source source
 * @param displayCRS crs of display
 */
public WMSMapSwing(URL mapURL, int width, int heigth, String layer,
                   CoordinateReferenceSystem displayCRS, String source) {
    initGeotoolsLocale();
    try {
        if (displayCRS == null) {
            setDisplayCRS(INITIAL_CRS);
        } else {
            setDisplayCRS(displayCRS);
        }
        this.source = source;
        this.sb = new StyleBuilder();
        this.sf = CommonFactoryFinder.getStyleFactory(null);
        this.ff = CommonFactoryFinder.getFilterFactory2(null);
        this.mapHeight = heigth;
        this.mapWidth = width;
        this.vBox = new VBox();
        this.wms = new WebMapServer(mapURL);
        List<Layer> layers = this.wms.getCapabilities().getLayerList();
        baseLayer = null;
        boolean layerFound = false;
        for (Layer outerLayer : layers) {
            String oname = outerLayer.getName();
            if (oname != null && oname.equalsIgnoreCase(layer)) {
                baseLayer = outerLayer;
                // we actually need to set both by hand, else the
                // request will fail
                baseLayer.setTitle(layer);
                baseLayer.setName(layer);
                layerFound = true;
            }
            for (Layer wmsLayer : outerLayer.getChildren()) {
                if (wmsLayer.getName().equalsIgnoreCase(layer)) {
                    baseLayer = wmsLayer.getParent();
                    baseLayer.setTitle(layer);
                    baseLayer.setName(layer);
                    layerFound = true;
                    break;
                }
            }
            if (layerFound) {
                break;
            }
        }
        this.mapContent = new MapContent();
        this.mapContent.setTitle(this.title);
        this.mapNode = new SwingNode();
        this.mapNode.setManaged(false);
        this.add(this.mapNode);
        this.getChildren().add(vBox);
        displayMap(baseLayer);

    } catch (IOException | ServiceException | FactoryException e) {
        log.log(Level.SEVERE, e.getMessage(), e);
    }
}
 
开发者ID:gdi-by,项目名称:downloadclient,代码行数:65,代码来源:WMSMapSwing.java

示例5: getWmsServer

import org.geotools.ows.ServiceException; //导入依赖的package包/类
private static WebMapServer getWmsServer(PropertySet configuration) throws IOException, ServiceException {
    return new WebMapServer((URL) configuration.getValue(WmsLayerType.PROPERTY_NAME_URL));
}
 
开发者ID:senbox-org,项目名称:snap-desktop,代码行数:4,代码来源:WmsLayerType.java

示例6: getValue

import org.geotools.ows.ServiceException; //导入依赖的package包/类
public Object getValue(Element element, ElementValue[] value, Attributes attrs, Map hints) throws SAXException, OperationNotSupportedException {
	return new ServiceException((String)value[value.length - 1].getValue(),null);
}
 
开发者ID:lizardtechblog,项目名称:ExpressZip,代码行数:4,代码来源:WMSComplexTypes.java

示例7: getInstanceType

import org.geotools.ows.ServiceException; //导入依赖的package包/类
public Class getInstanceType() {
	return ServiceException.class;
}
 
开发者ID:lizardtechblog,项目名称:ExpressZip,代码行数:4,代码来源:WMSComplexTypes.java


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