0
IM想寫一個.java文件,並將其導入52north WPS服務,但我的代碼是這樣的代碼哪個jar文件包含org.n52.wps.server.observerpattern.ISubject,我該如何下載它?
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
,我怎麼能立即下載呢?