Git Product home page Git Product logo

Comments (6)

ebocher avatar ebocher commented on August 27, 2024

The input and output types could be dynamically extended using an OSGI service registry.

from orbisdata.

ebocher avatar ebocher commented on August 27, 2024
//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)")] )] )

from orbisdata.

ebocher avatar ebocher commented on August 27, 2024
//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")])

from orbisdata.

ebocher avatar ebocher commented on August 27, 2024
//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"}]

from orbisdata.

ebocher avatar ebocher commented on August 27, 2024

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
    }

from orbisdata.

SPalominos avatar SPalominos commented on August 27, 2024

Next use case will be added directly to the test files.

from orbisdata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.