52north / javaps Goto Github PK
View Code? Open in Web Editor NEWNext generation standardized web-based geo-processing
License: Apache License 2.0
Next generation standardized web-based geo-processing
License: Apache License 2.0
javaps-rest
repository (https://github.com/autermann/javaps-rest)javaps-rest
(https://github.com/bpross-52n/javaps-rest) diverged from autermann
--> GitHub compare / Pull Request (autermann/javaps-rest@master...bpross-52n:master)rest
(subdirectory + module
in pom.xml
, with the contents of the javaps-rest
modulewebapp/pom.xml
to include the new module as a dependencyjavaps-rest/src/main/resources/components
) into webapp/src/main/resources/components
feature/rest-module
mvn jetty:run
There is no streamwriter that supports the class GetResultResponse and MediaType /. StreamingRawWriter only supports the class ExecuteResponse.
I created this issue at the (orphaned?) WPS repository:
To be honest, I am not 100% sure, if it is better described here ... however, this repository hosts the "new generation WPS", so it my get more attention here 😄
It is possible that a OutputEncodingException occurs in the Engine.run() method. This is not handled and this leads to follow-up exceptions.
After deploying JavaPS to Tomcat I noticed that I am missing a lot of stracktrace errors. Specifically when I have custom algorithm and it throws an error, this error is never printed in the javaps.log, catalina.out or any other log file that I can find. To work around this issue I am wrapping my execute methods in try catches so that I am able to catch almost all errors.
catch (Exception e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
log.error(sw.toString());
}
This code allows me to print errors to the javaps.log file. However it would be much nicer if the stacktrace/errors were not eaten at the JavaPS level. Is there a way the codebase can be improved to not eat algorithm errors?
Details to be defined.
Certain endpoints/operations need a security layer, e.g. getting the list of jobs, executing processes and deploying new processes.
Details to be defined (e.g. using Spring templates, ...)
I have several algorithms that run as commandline utilities. I have to publish them as WPS processes. Some of these processes need geotiff files as input.
I hava tried to use the GenericFileDataWithGTBinding
and GenericFileDataWithGT
to get the geotiff file at the server side
private GenericFileDataWithGT tiff;
@ComplexInput(identifier = "tiff", minOccurs = 1, maxOccurs = 1, binding = GenericFileDataWithGTBinding.class)
public void setTiff(GenericFileDataWithGT tiff) {
this.tiff = tiff;
}
@Execute
public void run() {
String path = tiff.getBaseFile(true).getAbsolutePath();
log.debug(tiff.getMimeType());
log.debug(path);
// return a GridCoverage2D object, error: the file is invalid.
this.result = GeoTiffUtils.read(path);
}
I hava tested the following codes using wps-client-lib
, but the file received at the server side is invalid, it is larger than the original file and cannot read by gdal. Besides, the received file is end with ..tmp
, not .tmp
or .tif
ExecuteRequestBuilder builder = new ExecuteRequestBuilder(describeProcessDocument);
File file = new File("J:/demos/zts.tif");
//FileInputStream is = new FileInputStream(file);
byte[] bytes = FileUtils.readFileToByteArray(file);
String s = Base64.encodeBytes(bytes);
//also tested using FileInputStream directly, got the same error
builder.addComplexData("dem", s, null, "base64", "image/tiff");
I'm not sure it's the client side error or server side error. The exception at the server side shown that it was caused by the invalid file.
Thanks very much!
I have tested the similar code (use GenericFileDataWithGTBinding
and GenericFileDataWithGT
to get the geotiff) using https://github.com/52North/WPS version 3.6.3, and I got the valid file!
In the LocalAlgorithmRepository, algorithms are instantiated only once at the initialization of the repo. The same instance is used by all executions of the algorithm. This leads to race conditions.
Proposed solution: Each execution needs its own algorithm instance.
Current packages specified in POM are Arctic Sea v7.2.0, however the package resolver cannot find up-to-date versions for some packages, resulting in build failure
related stack trace:
[INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for 52°North javaPS 1.4.0-SNAPSHOT: [INFO] [INFO] 52°North javaPS .................................... SUCCESS [ 3.986 s] [INFO] 52°North javaPS Processing API Implementation ...... FAILURE [ 14.714 s] [INFO] 52°North Iceland Streaming Interfaces .............. SKIPPED [INFO] 52°North javaPS Service Implementation ............. SKIPPED [INFO] 52°North javaPS KVP Binding ........................ SKIPPED [INFO] 52°North javaPS POX Binding ........................ SKIPPED [INFO] 52°North javaPS Webapp ............................. SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 19.036 s [INFO] Finished at: 2019-10-09T14:36:37-04:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project engine: Could not resolve dependencies for project org.n52.wps:engine:jar:1.4.0-SNAPSHOT: The following artifacts could not be resolved: org.n52.arctic-sea:shetland:jar :7.2.0-SNAPSHOT, org.n52.arctic-sea:iceland:jar:7.2.0-SNAPSHOT: Could not find artifact org.n52.arctic-sea:shetland:jar:7.2.0-SNAPSHOT -> [Help 1]
May have to do with 7.2.0 versions not being in sonatype directories. For now, our development will use a JavaPS version prior to 1.3.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.