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 a conf file for deriving josm osm #5452

Merged
merged 4 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions conf/core/DeriveJosmOsm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"#": "Only add entries here that different default values than the options in ConfigOptions.asciidoc",
"reader.keep.status.tag": "true",
"reader.use.file.status": "true",
"writer.include.debug.tags": "true",
"#": "end"
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* This will properly maintain the copyright information. Maxar
* copyrights will be updated automatically.
*
* @copyright Copyright (C) 2016, 2017, 2018, 2019, 2020, 2021 Maxar (http://www.maxar.com/)
* @copyright Copyright (C) 2016, 2017, 2018, 2019, 2020, 2021, 2022 Maxar (http://www.maxar.com/)
*/
package hoot.services.controllers.grail;

Expand All @@ -41,6 +41,8 @@ class DeriveChangesetCommand extends GrailCommand {
DeriveChangesetCommand(String jobId, GrailParams params, String debugLevel, Class<?> caller) {
super(jobId, params);

String confFile = "DeriveChangeset.conf";

List<String> options = new LinkedList<>();
options.add("api.db.email=" + params.getUser().getEmail());

Expand All @@ -53,17 +55,22 @@ class DeriveChangesetCommand extends GrailCommand {
options.add("bounds=" + params.getBounds());
}

if(params.getOutput().endsWith(".osm")) {
confFile = "DeriveJosmOsm.conf";
}

List<String> hootOptions = toHootOptions(options);

Map<String, Object> substitutionMap = new HashMap<>();
substitutionMap.put("CONF_FILE", confFile);
substitutionMap.put("INPUT1", params.getInput1());
substitutionMap.put("INPUT2", params.getInput2());
substitutionMap.put("OSC_FILE", params.getOutput());
substitutionMap.put("HOOT_OPTIONS", hootOptions);
substitutionMap.put("DEBUG_LEVEL", debugLevel);
substitutionMap.put("STATS_FILE", new File(params.getWorkDir(), "stats.json").getPath());

String command = "hoot.bin changeset-derive --${DEBUG_LEVEL} -C DeriveChangeset.conf ${HOOT_OPTIONS} ${INPUT1} ${INPUT2} ${OSC_FILE} --stats ${STATS_FILE}";
String command = "hoot.bin changeset-derive --${DEBUG_LEVEL} -C ${CONF_FILE} ${HOOT_OPTIONS} ${INPUT1} ${INPUT2} ${OSC_FILE} --stats ${STATS_FILE}";

super.configureCommand(command, substitutionMap, caller);
}
Expand Down
2 changes: 1 addition & 1 deletion hoot-ui-2x