use of org.locationtech.geowave.cli.osm.operations.options.OSMIngestCommandArgs in project geowave by locationtech.
the class OSMConversionMapper method setup.
@Override
protected void setup(final Context context) throws IOException, InterruptedException {
super.setup(context);
try {
globalVisibility = context.getConfiguration().get(AbstractMapReduceIngest.GLOBAL_VISIBILITY_KEY);
final String primaryIndexIdStr = context.getConfiguration().get(AbstractMapReduceIngest.INDEX_NAMES_KEY);
if (primaryIndexIdStr != null) {
indexName = primaryIndexIdStr;
}
final OSMIngestCommandArgs args = new OSMIngestCommandArgs();
args.deserializeFromString(context.getConfiguration().get("arguments"));
final DataStorePluginOptions storeOptions = GeoWaveOutputFormat.getStoreOptions(context);
osmProvider = new OsmProvider(args, (AccumuloRequiredOptions) storeOptions.getFactoryOptions());
} catch (final Exception e) {
throw new IllegalArgumentException(e);
}
}
use of org.locationtech.geowave.cli.osm.operations.options.OSMIngestCommandArgs in project geowave by locationtech.
the class OSMConversionRunner method main.
public static void main(final String[] args) throws Exception {
final OSMIngestCommandArgs ingestArgs = new OSMIngestCommandArgs();
final DataStorePluginOptions opts = new DataStorePluginOptions();
opts.selectPlugin(new AccumuloStoreFactoryFamily().getType());
final OperationParser parser = new OperationParser();
parser.addAdditionalObject(ingestArgs);
parser.addAdditionalObject(opts);
final CommandLineOperationParams params = parser.parse(args);
if (params.getSuccessCode() == 0) {
final OSMConversionRunner runner = new OSMConversionRunner(ingestArgs, opts);
final int res = ToolRunner.run(new Configuration(), runner, args);
System.exit(res);
}
System.out.println(params.getSuccessMessage());
System.exit(params.getSuccessCode());
}
use of org.locationtech.geowave.cli.osm.operations.options.OSMIngestCommandArgs in project geowave by locationtech.
the class OSMRunner method main.
public static void main(final String[] args) throws Exception {
final OSMIngestCommandArgs argv = new OSMIngestCommandArgs();
final DataStorePluginOptions opts = new DataStorePluginOptions();
opts.selectPlugin(new AccumuloStoreFactoryFamily().getType());
final OperationParser parser = new OperationParser();
parser.addAdditionalObject(argv);
parser.addAdditionalObject(opts);
final CommandLineOperationParams params = parser.parse(args);
if (params.getSuccessCode() == 0) {
final OSMRunner runner = new OSMRunner(argv, opts);
final int res = ToolRunner.run(new Configuration(), runner, args);
System.exit(res);
}
System.out.println(params.getSuccessMessage());
System.exit(params.getSuccessCode());
}
use of org.locationtech.geowave.cli.osm.operations.options.OSMIngestCommandArgs in project geowave by locationtech.
the class IngestOSMToGeoWaveCommand method convertData.
private List<String> convertData() throws Exception {
FeatureDefinitionSet.initialize(new OSMIngestCommandArgs().getMappingContents());
final OSMConversionRunner runner = new OSMConversionRunner(ingestOptions, inputStoreOptions);
final int res = ToolRunner.run(runner, new String[] {});
if (res != 0) {
throw new RuntimeException("OSMConversionRunner failed: " + res);
}
final List<String> output = new ArrayList<>();
output.add("finished conversion");
output.add("**************************************************");
output.add("**************************************************");
output.add("**************************************************");
return output;
}
Aggregations