-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Orbisprocess #43
Comments
The input and output types could be dynamically extended using an OSGI service registry. |
//Compute a buffer around a geometry and returns a new geometry
//Geometry types supported are JTS Geometry classes
Process p = new Process("Create a buffer around a geometry",[inputA: Geometry, distance: double], [outputA: Geometry], { inputA, distance ->
[outputA: inputA.buffer(distance)]
}
)
p.execute([inputA : new WKTReader().read("POINT(10 1)")] )] ) |
//Example with a table from H2GIS
def h2GIS = H2GIS.open([databaseName: './target/loadH2GIS'])
h2GIS.execute("""
DROP TABLE IF EXISTS h2gis, super;
CREATE TABLE h2gis (id int, the_geom point);
INSERT INTO h2gis VALUES (1, 'POINT(10 10)'::GEOMETRY), (2, 'POINT(1 1)'::GEOMETRY);
""")
Process p = new Process([inputA: ITable],[outputA: String], { inputA ->
[outputA: inputA.columnNames]
}
)
p.execute([inputA : h2GIS.getSpatialTable("h2gis")])
|
Implements the process manager API. Fix the pom for the JAVA 8 compilation. Integrate test from #43
//An advanced type of the String with custom parameters
//Custom parameters must be controlled, thanks to the Caster.class
Process p = new Process([inputA: [title:'My input', type : String, minOccurs=1 maxOccurs=1] ],[outputA: String], { inputA ->
[outputA: inputA.columnNames]
}
)
p.execute([inputA : "A string value"])
Below a possible list of input types [title : "A title", type : BoudingBox, supportedCRS = {"EPSG:4326", "EPSG:2000", "EPSG:2001"}, dimension = 2] [title : "A title", type : RawData, multiSelection = true, isDirectory = false, isFile = false,excludedTypes = {".sql", ".shp"}, fileTypes = {".dbf", ".txt"}] [title : "A title", type : EnumData, isEditable = true, multiSelection = true, values = {"value1", "value2"}, names = {"name1","name2"}] |
A new use case @Test
void testSimpleProcess5(){
def process = processFactory.create(
"title",
[inputA : String[]],
[outputA : String],
{ inputA -> [outputA : inputA[1]] }
)
process.execute([inputA :["A", "B", "C"]])
assertEquals "B", process.getResults().outputA
} |
Next use case will be added directly to the test files. |
I share here some examples about orbisprocess library. A library to write process based on orbiswps job and the famous geoscript library.
Note that the input and output parameters must be controlled.
The text was updated successfully, but these errors were encountered: