Skip to content
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

Add CLI for running operations #451

Merged
merged 4 commits into from
Jul 18, 2019
Merged

Conversation

dr-jts
Copy link
Contributor

@dr-jts dr-jts commented Jul 18, 2019

Add CLIs for running operations

dr-jts added 4 commits July 18, 2019 09:15
Signed-off-by: Martin Davis <[email protected]>
Signed-off-by: Martin Davis <[email protected]>
Signed-off-by: Martin Davis <[email protected]>
@dr-jts dr-jts merged commit 3e45657 into locationtech:master Jul 18, 2019
@dr-jts dr-jts deleted the add-test-op-cli branch July 18, 2019 19:11
@jnh5y
Copy link
Contributor

jnh5y commented Jul 18, 2019

@dr-jts This looks like fun, so I wanted to try it out.

I think the testbuilderop.sh needs to reference JTSTestBuilder.jar instead of JTSTestRunner.jar.
(E.g., the last line should be...)
java -cp ${JTS_LIB_DIR}/JTSTestBuilder.jar org.locationtech.jtstest.testbuilder.cmd.TestBuilderOpCmd $@

Separate from that, can you give a quick example of using the new command line tool?

@dr-jts
Copy link
Contributor Author

dr-jts commented Jul 18, 2019

Right, that reference to JTSTestRunner.jar is a copy-paste bug. I'll fix it very shortly

@dr-jts
Copy link
Contributor Author

dr-jts commented Jul 18, 2019

An example of running is:

testbuilderop -op Overly.unaryUnion -afile some-file-with-geom.wkt -output wkb

That reads the WKT file (containing one or more geometries), executes the Overlay.unaryUnion operation (which is just a synonym for Geometry.union() in this case), and outputs the result as WKB.

@dr-jts
Copy link
Contributor Author

dr-jts commented Jul 18, 2019

One slightly confusing thing is that the -op arg has to be Category.function, which are listed in the TestBuilder Spatial Function panel tree view.

If Category is omitted, Geometry is assumed. But only some Geometry methods are actually given under the Geometry category. So that might be bit confusing. I think I'll add all the Geometry methods there, so that it's more obvious. I will also add a dump of the full list of function names that are available (triggered by a -help argument).

Thx for testing this out - let me know how it goes.

@dr-jts
Copy link
Contributor Author

dr-jts commented Jul 18, 2019

Updated to fix issue and add operations listing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants