- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想在北52号开发一个wps流程,我应该使用org.n52.wps.server.AbstractSelfDescribingAlgorithm
所以这个类继承自 net.opengis.wps.x100.ProcessDescriptionType
。我的问题是哪个jar文件包含这种类型,请告诉我下载这个jar文件的网址?!我的代码是:
package www.gise.cse.iitb.ac.in;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.n52.wps.io.data.IData;
import org.n52.wps.io.data.binding.literal.LiteralDoubleBinding;
import org.n52.wps.server.AbstractSelfDescribingAlgorithm;
public class AddNumbersAlgo extends org.n52.wps.server.AbstractSelfDescribingAlgorithm {
@Override
public Class getInputDataType(String arg0) {
// TODO Auto-generated method stub
if (arg0.equals("Num1")){
//return GTVectorDataBinding.class;
return LiteralDoubleBinding.class;
}
if (arg0.equals("Num2")){
//return GTVectorDataBinding.class;
return LiteralDoubleBinding.class;
}
throw new RuntimeException("Error: WrongIdentifier");
}
@Override
public Class getOutputDataType(String arg0) {
// TODO Auto-generated method stub
if(arg0.equals("AdditionResult")){
return LiteralDoubleBinding.class;
}
throw new RuntimeException("Error: Wrong identifier");
}
@Override
public Map<String, IData> run(Map<String, List<IData>> arg0) {
if (arg0 == null || !arg0.containsKey("Num1")){
throw new RuntimeException("Error: While allocating Input Parameters");
}
if (arg0 == null || !arg0.containsKey("Num2")){
throw new RuntimeException("Error: While allocating Input Parameters");
}
List<IData> datalist = arg0.get("Num1");
if(datalist == null || datalist.size()!=1){
throw new RuntimeException("Error:While allocating Input Parameters");
}
//Checking for correctness of input
List<IData> datalist1 = arg0.get("Num2");
if(datalist1 == null || datalist1.size()!=1){
throw new RuntimeException("Error:While allocating Input Parameters");
}
//Extracting input
IData Num1 = datalist.get(0);
double firstNum = ((LiteralDoubleBinding)Num1).getPayload();
System.out.println(Num1);
System.out.println(firstNum);
IData Num2 = datalist1.get(0);
double secondNum = ((LiteralDoubleBinding)Num2).getPayload();
System.out.println(Num2);
System.out.println(secondNum);
double Result = firstNum + secondNum;
//double AdditionResult;
//create the response. In this case a GenericFileDataBinding is used (see this.getOutputDataType(...)
IData AdditionResult = new LiteralDoubleBinding(Result);
//new Map created
Map<String, IData> resultMap = new HashMap<String, IData>();
//created response added to corresponding identifier (see this.getOutputIdentifiers())
resultMap.put("AdditionResult", AdditionResult);
return resultMap;
}
@Override
public List<String> getInputIdentifiers() {
// TODO Auto-generated method stub
List<String> identifiers = new ArrayList<String>();
identifiers.add("Num1");
identifiers.add("Num2");
return identifiers;
}
@Override
public List<String> getOutputIdentifiers() {
// TODO Auto-generated method stub
List<String> identifiers = new ArrayList<String>();
identifiers.add("AdditionResult");
return identifiers;
}
错误是:
Multiple markers at this line
The type
net.opengis.wps.x100.ProcessDescriptionType
cannot be resolved. It is indirectly referenced from required .class filesThe type
net.opengis.wps.x100.ProcessDescriptionType
cannot be resolved. It is indirectly referenced from required .class files
最佳答案
我建议使用 Maven 管理的项目。创建此类项目所需的所有工件都位于公共(public) 52north maven 存储库中(包括您提到的 XML 绑定(bind)库)。以下 pom.xml 应该可以很好地作为项目框架。它已经包含了前面提到的 Maven 存储库。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>my.test.wps-project</groupId>
<artifactId>wps</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.n52.wps</groupId>
<artifactId>52n-wps-io</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.n52.wps</groupId>
<artifactId>52n-wps-algorithm</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>n52-releases</id>
<name>n52-releases</name>
<url>http://52north.org/maven/repo/releases/</url>
</repository>
</repositories>
</project>
一般来说,maven 管理的开源项目的工件应该可以在专用或中央存储库上访问。否则项目build设置将无法得到满足。因此,一般建议是首先对项目结构进行一些调查。
关于java - 哪个 jar 文件包含 net.opengis.wps.x100 以及如何下载它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16063652/
/usr/share/spark-3.0/bin/pyspark --queue=szsc --master=yarn --packages org.apache.sedona:sedona-core
我想在北52号开发一个wps流程,我应该使用org.n52.wps.server.AbstractSelfDescribingAlgorithm所以这个类继承自 net.opengis.wps.x10
我遇到了一个奇怪的情况。我使用 geotools 来投影栅格,它可以工作,例如 CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:3857"
我正在将我的 java 应用程序导出到单个 JAR 文件中,但是当我尝试执行它时,我总是遇到相同的错误。 java.lang.NoClassDefFoundError:org/opengis/feat
我正在尝试使用 JAXB 为该模式生成类:http://schemas.opengis.net/wfs/1.1.0/wfs.xsd 我将该模式下载到本地文件,现在我正在尝试生成 JAXB 类。首先我得
我是一名优秀的程序员,十分优秀!