【问题标题】:which jar file contain org.n52.wps.server.observerpattern.ISubject and how can I download it?哪个 jar 文件包含 org.n52.wps.server.observerpattern.ISubject 以及如何下载它?
【发布时间】:2013-04-27 11:20:57
【问题描述】:

我想编写一个 .java 文件并将其导入 52north wps 服务但是我的代码是这样的

package org.n52.wps.demo;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.geotools.feature.FeatureCollection;
import org.geotools.feature.FeatureIterator;
import org.geotools.geometry.iso.topograph2D.Coordinate;
import org.geotools.geometry.jts.CoordinateSequenceTransformer;
import org.n52.wps.server.AbstractSelfDescribingAlgorithm;
import org.n52.wps.io.data.IData;
import org.n52.wps.io.data.binding.complex.GTVectorDataBinding;


import net.opengis.wps.x100.ProcessDescriptionType;
public class ConvexHullDemo extends AbstractSelfDescribingAlgorithm {

@Override
public Class<?> getInputDataType(String identifier) {
    if (identifier.equalsIgnoreCase("FEATURES")) {
        return GTVectorDataBinding.class;
    }
}

@Override
public Class<?> getOutputDataType(String identifier) {
    if (identifier.equalsIgnoreCase("FEATURE")) {
        return GTVectorDataBinding.class;
    }
}

@Override
public List<String> getInputIdentifiers() {
    List<String> list=new ArrayList<String>();
    list.add("FEATURES");
    return list;
}

@Override
public List<String> getOutputIdentifiers() {
    List<String> list=new ArrayList<String>();
    list.add("polygon");
    return list;
}

@Override
public Map<String, IData> run(Map<String, List<IData>> inputData) {

    if (inputData == null || !inputData.containsKey("FEATURES")) {
        throw new RuntimeException("Error while allocating input parameters");
}

List<IData> dataList = inputData.get("FEATURES");

if (dataList == null || dataList.size() != 1) {
        throw new RuntimeException("Error while allocating input parameters");
}

IData firstInputData = dataList.get(0);
FeatureCollection featureCollection = ((GTVectorDataBinding) firstInputData).getPayload();
}

FeatureIterator iter = featureCollection.
List<Coordinate> coordinateList = new ArrayList<Coordinate>();
int counter = 0;
Geometry unifiedGeometry = null;
while (iter.hasNext()) {
                SimpleFeature feature = (SimpleFeature) iter.next();
                if (feature.getDefaultGeometry() == null) {
                        throw new NullPointerException("defaultGeometry is null in feature id: "+ feature.getID());
                }
                Geometry geom = (Geometry) feature.getDefaultGeometry();
                Coordinate[] coordinateArray = geom.getCoordinates();
                for(Coordinate coordinate : coordinateArray){
                        coordinateList.add(coordinate);
                }
}

}

此代码的完整教程:Custom 52north WPS by java Process

但是出现了这个错误:

这一行有多个标记

  • ConvexHullDemo 类型的层次结构不一致

  • org.n52.wps.server.observerpattern.ISubject 类型无法解析。它是从所需的 .class 文件中间接引用的

哪个 jar 包含此 org.n52.wps.server.observerpattern.ISubject,我如何下载它?

【问题讨论】:

    标签: java gis


    【解决方案1】:

    在发布您的问题之前,您可能需要阅读更多内容,因为我在您链接的网站上找到了您的问题的遮篷:

    它说您应该设置 WPS,如下所述: https://wiki.52north.org/bin/view/Processing/52nWebProcessingService

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-01-13
      • 2013-01-03
      • 1970-01-01
      • 2016-10-29
      • 1970-01-01
      • 2020-06-22
      • 2010-09-28
      相关资源
      最近更新 更多