Package: hoot
pyhootThese are the unofficial Python bindings forHootenanny.Hootenanny is an open source map data conflation tool developed with machine learning
techniques to facilitate automated and semi-automated conflation of critical Foundation
GEOINT features in the topographic domain. In short, it merges multiple maps into a single
seamless map.To call this alpha software would be generous. This wrapper aims to slowly wrap the parts of hoot
that are requested and no more. A 1:1 mapping will be maintained where possible while accounting
for Python conventions (e.g. snake_case). If you need a specific feature, please head on over to
ourGitHub repoand let us know.To see a complete list of wrapped code type this from the command line:python -c "import hoot; help(hoot.libpyhoot)"Where appropriate conventions are converted from Hoot's c++ coding standard to typical Python
conventions. E.g. the methodgetChildWeight()is converted either toget_child_weight()or
a property namedchild_weight.BugsBEWARE: due to the early stages of this implementation, nearly no testing is run on this build of
hoot. While we're using hoot source code, we may be using different versions of libraries which
can sometimes have unexpected side effects. If you're running into a strange issue or crashes this
is most likely due to pyhoot and should be reported to the pyhoot github first and we will
escalate to the main hoot repo if needed.As/if pyhoot matures and regression tests are put into place, these issues will go away.Known Issues:GLPK gives an unexpected segfault so GLPK based optimization is disabled by default.HOOT_HOME is not being properly set in every environment. On Amazon Linux set it with:export HOOT_HOME=/home/ec2-user/.local/lib/python3.7/site-packages/hootpyhoot is built from Hootenanny 0.2.64. Upgrading to a later version of Hootenanny is not a
trivial process, so regular upgrades are not currently planned but may be possible in the future.InstallationAt this time, pyhoot is available for Python 3.7.Installing on CentOS 7:sudo yum install libSM libX11 libXext libXrender
python3 -m pip install hootExamplesThe following python example conflates two sample files that come with pyhoot and writes the result
toout.osm:import hoot

hoot.PythonConflateExecutor().conflate(hoot.TOY_TEST_A_PATH, hoot.TOY_TEST_B_PATH, "out.osm")The next python example conflates the same two sample files and defines a schema translation for the
data and custom map operations to run before and after conflation:import hoot

custom_op_1 = CustomOp()
custom_op_2 = CustomOp()

conflator = hoot.PythonConflateExecutor()
conflator.pre_ops = [custom_op_1.op_func]
conflator.pre_op_names = ["CustomOp1"]
conflator.pre_ops = [custom_op_2.op_func]
conflator.pre_op_names = ["CustomOp2"]

conflator.conflate(hoot.TOY_TEST_A_PATH, hoot.TOY_TEST_B_PATH, "out.osm")DocumentationTo see what classes and functions are available via pyhoot, use Python's help:import hoot
help(hoot.libpyhoot)Please see theHootenanny documentationfor detailed usage instructions.pyhoot uses the same names but converts them to python style conventions. E.g. snake_case for
functions.For example, this C++ code:Tags tags;
tags.set("name", "foo");
LOG_VAR(tags.getName());Is equivalent to the following Python:import hoot
tags = hoot.Tags()
tags["name"] = "foo"
hoot.log_var(tags.getName())Command Line InterfaceThe Hootenanny CLI is conveniently wrapped in a python call:python -m hoot conflate $HOOT_HOME/ToyTestA.osm $HOOT_HOME/ToyTestB.osm out.osmDevelopment Environmenthttps://github.com/epochgeo/pyhoot/blob/main/docs/600-developer-docs.md