Search in sources :

Example 1 with OSMIngestCommandArgs

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);
    }
}
Also used : AccumuloRequiredOptions(org.locationtech.geowave.datastore.accumulo.config.AccumuloRequiredOptions) OSMIngestCommandArgs(org.locationtech.geowave.cli.osm.operations.options.OSMIngestCommandArgs) DataStorePluginOptions(org.locationtech.geowave.core.store.cli.store.DataStorePluginOptions) OsmProvider(org.locationtech.geowave.cli.osm.mapreduce.Convert.OsmProvider.OsmProvider) IOException(java.io.IOException)

Example 2 with OSMIngestCommandArgs

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());
}
Also used : OSMIngestCommandArgs(org.locationtech.geowave.cli.osm.operations.options.OSMIngestCommandArgs) DataStorePluginOptions(org.locationtech.geowave.core.store.cli.store.DataStorePluginOptions) Configuration(org.apache.hadoop.conf.Configuration) ClientConfiguration(org.apache.accumulo.core.client.ClientConfiguration) CommandLineOperationParams(org.locationtech.geowave.core.cli.parser.CommandLineOperationParams) AccumuloStoreFactoryFamily(org.locationtech.geowave.datastore.accumulo.AccumuloStoreFactoryFamily) OperationParser(org.locationtech.geowave.core.cli.parser.OperationParser)

Example 3 with OSMIngestCommandArgs

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());
}
Also used : OSMIngestCommandArgs(org.locationtech.geowave.cli.osm.operations.options.OSMIngestCommandArgs) DataStorePluginOptions(org.locationtech.geowave.core.store.cli.store.DataStorePluginOptions) Configuration(org.apache.hadoop.conf.Configuration) ClientConfiguration(org.apache.accumulo.core.client.ClientConfiguration) CommandLineOperationParams(org.locationtech.geowave.core.cli.parser.CommandLineOperationParams) AccumuloStoreFactoryFamily(org.locationtech.geowave.datastore.accumulo.AccumuloStoreFactoryFamily) OperationParser(org.locationtech.geowave.core.cli.parser.OperationParser)

Example 4 with OSMIngestCommandArgs

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;
}
Also used : OSMIngestCommandArgs(org.locationtech.geowave.cli.osm.operations.options.OSMIngestCommandArgs) OSMConversionRunner(org.locationtech.geowave.cli.osm.mapreduce.Convert.OSMConversionRunner) ArrayList(java.util.ArrayList)

Aggregations

OSMIngestCommandArgs (org.locationtech.geowave.cli.osm.operations.options.OSMIngestCommandArgs)4 DataStorePluginOptions (org.locationtech.geowave.core.store.cli.store.DataStorePluginOptions)3 ClientConfiguration (org.apache.accumulo.core.client.ClientConfiguration)2 Configuration (org.apache.hadoop.conf.Configuration)2 CommandLineOperationParams (org.locationtech.geowave.core.cli.parser.CommandLineOperationParams)2 OperationParser (org.locationtech.geowave.core.cli.parser.OperationParser)2 AccumuloStoreFactoryFamily (org.locationtech.geowave.datastore.accumulo.AccumuloStoreFactoryFamily)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 OSMConversionRunner (org.locationtech.geowave.cli.osm.mapreduce.Convert.OSMConversionRunner)1 OsmProvider (org.locationtech.geowave.cli.osm.mapreduce.Convert.OsmProvider.OsmProvider)1 AccumuloRequiredOptions (org.locationtech.geowave.datastore.accumulo.config.AccumuloRequiredOptions)1