8.11. GeoTools Command-Line Tools¶
The GeoMesa GeoTools distribution includes a set of command-line tools that can work with most non-GeoMesa data store implementations to provide feature management, ingest and export. This allows the use of GeoMesa converters and output encodings to be used with non-GeoMesa data stores.
GeoMesa GeoTools artifacts are available for download or can be built from source. The easiest way to get started is to download the most recent binary version (3.1.2) from GitHub.
Extract it somewhere convenient:
# download and unpackage the most recent distribution: $ wget "https://github.com/locationtech/geomesa/releases/download/geomesa_2.11-$VERSION/geomesa-gt_2.11-$VERSION-bin.tar.gz" $ tar xvf geomesa-gt_2.11-$VERSION-bin.tar.gz $ cd geomesa-gt_2.11-$VERSION $ ls bin/ conf/ dist/ docs/ examples/ lib/ LICENSE.txt logs/
Alternatively, it may be built from source. For more information refer to Building from Source
in the developer manual, or to the
README.md file in the the source distribution. If you have built from
source, the distribution is created in the
target directory of
22.214.171.124. Setting up the Command Line Tools¶
Once installed, the command line tools can be invoked by running the script
geomesa-gt located in the binary
The tools ship with some default GeoTools data stores, such as support for Postgis and shapefiles. For other stores,
you will need to copy the appropriate JARs into the tools
Environment variables can be specified in
conf/*-env.sh and dependency versions can be
geomesa-gt will load JARs from the
$GEOMESA_EXTRA_CLASSPATHS environment variable
into the class path. Use the
geomesa-gt classpath command in order to see what JARs are being used.
Due to licensing restrictions, dependencies for shape file support must be separately installed. Do this with the following command:
geomesa-gt without arguments to confirm that the tools work.
$ bin/geomesa-gt INFO Usage: geomesa-gt [command] [command options] Commands: ...
126.96.36.199. Setting up Distributed Processing¶
GeoMesa supports running map/reduce jobs for ingest and export. If you have a local Hadoop installation,
the tools will read the
$HADOOP_HOME environment variable to load the appropriate JAR files for Hadoop.
If you do not have a local Hadoop installation, then in order to run distributed jobs you will need to manually
install the Hadoop configuration files into the tools
conf folder, and the Hadoop JARs into the tools
folder. To install JARs, use the script provided with the distribution:
$ ./bin/install-dependencies.sh lib
If you installed JARs for any additional data stores, you will need to add them to the Hadoop libjars path
by modifying the file
org/locationtech/geomesa/geotools/tools/gt-libjars.list inside the JAR
8.11.2. General Arguments¶
Most commands require you to specify the connection to your data store. Parameters can be passed in using the
--param argument, which can be repeated in order to specify multiple parameters. Alternatively, the
argument can be used to specify a Java properties file containing the parameters. This may be useful for
simplifying the command invocation, or to hide sensitive parameters from bash history and process lists. If both
--params are used, then parameters specified directly will take precedence over ones from the
For example, to connect to a Postgis data store, you may use the following command:
$ bin/geomesa-gt export --param dbtype=postgis --param host=localhost \ --param user=postgres --param passwd=postgres --param port=5432 \ --param database=example --feature-name gdelt