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

Command refactoring and more #2397

Merged
merged 53 commits into from May 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1deba7f
consolidate convert commands (old ones still remain for now)
bwitham May 17, 2018
b133ae3
some bug fixes
bwitham May 18, 2018
cf4f6a8
some more bug fixes
bwitham May 21, 2018
2429ad5
fix handling of file geodb dirs
bwitham May 21, 2018
ebbc74f
fix a test
bwitham May 21, 2018
913fa08
fix bug with handling of convert ops
bwitham May 21, 2018
a51d06b
fix bug with handling of PG OGR urls
bwitham May 21, 2018
cf94f0c
fix invalid input specified in a test
bwitham May 21, 2018
de63769
move data conversion into its own class separate from the convert com…
bwitham May 21, 2018
5a1dcdc
collapse tile calculate commands into a single command
bwitham May 21, 2018
9c17e38
copyright header updates
bwitham May 21, 2018
13ec1c1
collapse conflation commands into single; disable cum conflate
bwitham May 21, 2018
7e250c7
archive some documentation
bwitham May 21, 2018
f3b03b0
resolve merge conflicts
bwitham May 22, 2018
47dd97d
resolve merge conflicts
bwitham May 22, 2018
6051501
fix docs
bwitham May 22, 2018
7f68e43
fix test
bwitham May 22, 2018
2404f9b
convert command batch processing prototype
bwitham May 22, 2018
e873fad
remove batch processing feature
bwitham May 22, 2018
79d8814
remove batch processing feature
bwitham May 22, 2018
2b02237
remove batch processing feature
bwitham May 22, 2018
145c1da
add DataConverterTest
bwitham May 23, 2018
4e90aff
add stats for railways
bwitham May 23, 2018
a91b2fc
Merge branch 'develop' into 2379
bwitham May 23, 2018
bb0a35d
Merge branch '2379' into add-railway-stats
bwitham May 23, 2018
5123398
fix tests
bwitham May 23, 2018
8635cff
fix tests; copyright header updates
bwitham May 23, 2018
d6a8aac
fix tests
bwitham May 23, 2018
d4b9f9a
more test fixes
bwitham May 23, 2018
d227c84
copyright header updates
bwitham May 23, 2018
bd5e587
fix test
bwitham May 23, 2018
56f2134
fix tests
bwitham May 23, 2018
7d7f40b
Merge branch 'develop' into 2379
bwitham May 23, 2018
f22d0a8
Merge branch 'develop' into 2379
bwitham May 24, 2018
7f9acc6
fix tests
bwitham May 24, 2018
5e9bbf6
simplify shape export with cols
bwitham May 24, 2018
6e1b080
cleanup
bwitham May 24, 2018
f3ba2b1
cleanup
bwitham May 24, 2018
bf1fc78
Merge branch '2379' of github.com:ngageoint/hootenanny into 2379
bwitham May 24, 2018
8ca2aaa
allow for non OGR inputs when converting to OGR
bwitham May 25, 2018
dab1881
allow for non OGR inputs when converting to OGR
bwitham May 25, 2018
403a9cd
cleanup
bwitham May 25, 2018
4e6079f
comments
bwitham May 25, 2018
b093eeb
fix test
bwitham May 25, 2018
6eaef81
fix bug in services
bwitham May 29, 2018
978fbfb
fix from ogr conversion
bwitham May 29, 2018
da869dc
fix bug in general convert routine translation
bwitham May 29, 2018
84dc698
collapse perty commands into one
bwitham May 29, 2018
83baf06
Add github pull-request support to sonar scan pipeline (#2412)
sputnam May 24, 2018
ea20ed1
Removing more false assertions and protecting empty string references…
bmarchant May 24, 2018
182e760
copyright header update
bwitham May 29, 2018
51769ac
remove unneeded cache setup from convert cmd
bwitham May 29, 2018
30eae3c
some qube changes
bwitham May 29, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile.am
Expand Up @@ -70,8 +70,8 @@ help:
@echo "services-docs - If configure '--with-services', then builds just the web services documentation."
@echo "services-test - If configure '--with-services', then runs the web services slow tests. Should take five to ten minutes."
@echo "services-test-all - If configure '--with-services', then runs the web services glacial tests. Should take five to ten minutes."
@echo "test - Run slow tests. Should take five to ten minutes."
@echo "test-all - Run all tests. Could take hours."
@echo "test - Run slow tests. Should take no more than five to ten minutes."
@echo "test-all - Run all tests. Could take more than ten minutes."
@echo "test-quick - Run quick tests. Should take less than five minutes."
@echo "ui-build - Build the web UI js/css dist. Must enable --with-services configuration options."
@echo "ui-test - Run user interface tests. May take several minutes. Must enable --with-uitests and --with-services configuration options."
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -63,6 +63,7 @@ typing 'hoot' at the command line in the Hootenanny environment. More detail is

# Supported Data Formats
**Hootenanny can import from:**
* OGR supported formats
* ESRI File Geodatabase (.gdb)
* GeoJSON (.geojson) (M)
* geonames.org (.geonames)
Expand All @@ -73,9 +74,9 @@ typing 'hoot' at the command line in the Hootenanny environment. More detail is
* OpenStreetMap API Database (osmapidb://)
* Shapefile (.shp)
* Zip files containing shapefiles and/or ESRI File Geodatabase files (.zip)
* OGR supported formats

**Hootenanny can export to:**
* OGR supported formats
* ESRI File Geodatabase (.gdb)
* GeoJSON (.geojson) (M)
* Hootenanny API Database (hootapidb://)
Expand All @@ -84,7 +85,6 @@ typing 'hoot' at the command line in the Hootenanny environment. More detail is
* OpenStreetMap Protocol Buffers file (.osm.pbf)
* OpenStreetMap API Database (osmapidb://)
* Shapefile (.shp) (M)
* OGR supported formats

**Hootenanny can export changesets to:**
* OpenStreetMap XML changeset file (.osc) (M)
Expand Down
41 changes: 19 additions & 22 deletions conf/core/ConfigOptions.asciidoc
Expand Up @@ -12,7 +12,7 @@
// * What does this configuration change?
// * If relevant, what are the units of the config option (e.g. meters)?
// * Where can the user go to get more information? Please reference the
// appropriate document. E.g. "See `convert-ogr2osm` in the _Command Line
// appropriate document. E.g. "See `convert` in the _Command Line
// Reference_ for more information."
// * What other options may be of interest? E.g. "See also
// `big.perty.op.sigma`"
Expand Down Expand Up @@ -484,8 +484,8 @@ the convert.bounding.box setting for OSM API database data sources only.
* Default Value:
** ``

Specifies one or more semi-colon delimited operations to perform before writing data. This is only
applicable to the convert command.
Specifies one or more semi-colon delimited operations to perform before writing converted data.
This is only applicable to the convert command.

=== cookie.cutter.alpha

Expand Down Expand Up @@ -830,7 +830,7 @@ of assigning IDs within OSM.
Example Usage:

----
hoot convert-ogr2osm -D id.generator=hoot::PositiveIdGenerator -D id.generator.node.start=100 -D id.generator.relation.start=200 -D id.generator.way.start=300 $HOOT_HOME/translations/Identity.js myoutput.osm myinput.osm
hoot convert -D id.generator=hoot::PositiveIdGenerator -D id.generator.node.start=100 -D id.generator.relation.start=200 -D id.generator.way.start=300 myinput.osm myoutput.osm --trans $HOOT_HOME/translations/Identity.js
----

=== id.generator.node.start
Expand Down Expand Up @@ -1255,7 +1255,7 @@ RAM usage of applications in a shared server environment.
* Data Type: double
* Default Value: `1.0`

When merging nodes during convert-ogr2osm, determines what tolerance should be used for deciding two nodes
When merging nodes during convert, determines what tolerance should be used for deciding two nodes
are identical. Units in meters and defaults to 1.0m.

[[merger.creators]]
Expand Down Expand Up @@ -1528,7 +1528,7 @@ intelligently use indexes, others will simply filter features after reading from
Example Usage:

----
hoot convert-ogr2osm -D ogr.reader.bounding.box=106.851,-6.160,107.052,-5.913 translations/Identity.js output.osm test-files/jakarta_raya_coastline.shp
hoot convert -D ogr.reader.bounding.box=106.851,-6.160,107.052,-5.913 test-files/jakarta_raya_coastline.shp output.osm --trans translations/Identity.js
----

=== ogr.reader.bounding.box.latlng
Expand Down Expand Up @@ -1645,14 +1645,20 @@ hoot convert \
PG:"dbname='osm_gis2' host='localhost' port='5432' user='hoot' password='hoottest'"
----

=== ogr2osm.ops
=== ogr2osm.merge.nearby.nodes

* Data Type: list
* Default Value:
** `hoot::MergeNearbyNodes` - Merges nodes within the distance defined by merge.nearby.nodes.distance.
** `hoot::BuildingPartMergeOp` - Implicitly merges certain individual building parts into a single part.
* Data Type: bool
* Default Value: `true`

Merges nearby nodes together when converting from an OGR format to OSM.

=== ogr2osm.simplify.complex.buildings

* Data Type: bool
* Default Value: `true`

Operations that should be applied to ingested OGR data before saving the data.
Implicitly merges certain individual building parts into a single part when converting from an OGR
format to OSM.

=== osmapidb.bulk.inserter.disable.database.constraints.during.write

Expand Down Expand Up @@ -1748,14 +1754,6 @@ written if the value is not empty.
If true, the OSM map writer will NOT write a file if the map is empty.
The default is to write a file even if the map is empty.

=== osm2ogr.ops

* Data Type: list
* Default Value:
** ``

User specified operations for converting OSM files to OGR compatible file types.

=== perty.apply.rubber.sheet

* Data Type: bool
Expand Down Expand Up @@ -2917,7 +2915,7 @@ NOTE: This assumes that you know exactly what tags you want to modify/delete
* Data Type: string
* Default Value: ``

The script to use for translation.
The script used by the TranslationVisitor for translation.

=== unify.enable.optimal.constrained.matches

Expand Down Expand Up @@ -2958,7 +2956,6 @@ before the operations in `conflate.post.ops`.
* Default Value:
** ``


List of operations to apply immediately before conflating when using Unifying Conflation only. Runs
after the operations in `conflate.pre.ops`.

Expand Down
7 changes: 2 additions & 5 deletions conf/core/RemoveReview2Pre.conf
@@ -1,11 +1,8 @@
{
"#" : "Options to remove all to-be-reviewed elements before conflation, convert or osm2ogr.",
"osm2ogr.ops": "hoot::RemoveElementsVisitor",
"unify.pre.ops": "$(unify.pre.ops);hoot::RemoveElementsVisitor",
"#" : "Options to remove all to-be-reviewed elements before conflation",
"convert.ops": "hoot::RemoveElementsVisitor",
"unify.pre.ops": "$(unify.pre.ops);hoot::RemoveElementsVisitor",
"remove.elements.visitor.filter": "hoot::TagCriterion",
"tag.criterion.kvp": "hoot:review:source,2",


"#" : "end"
}
3 changes: 1 addition & 2 deletions conf/core/TdsExport.json
Expand Up @@ -3,10 +3,9 @@
"unify.post.ops": "hoot::RemoveElementsVisitor",
"remove.elements.visitor.filter": "hoot::TagFilter",
"tag.filter.kvp": "hoot:review:source,2",
"osm2ogr.ops": "$(osm2ogr.ops);hoot::SmallWayMerger",
"convert.ops": "$(convert.ops);hoot::SmallWayMerger",
"small.way.merger.diff": "hoot::TranslatedTagDifferencer",
"translated.tag.differencer.script": "$(HOOT_HOME)/translations/TDSv40.js",
"translated.tag.differencer.ignore.list": "UFI",

"#" : "end"
}
2 changes: 1 addition & 1 deletion conf/services/conflateAdvOps.json
Expand Up @@ -349,7 +349,7 @@
"id":"merge_nearby_nodes_distance",
"minvalue":"0.01",
"elem_type":"double",
"description":"When merging nodes during ogr2osm, determines what tolerance should be used for deciding two nodes are identical. Units in meters and defaults to 1.0m.",
"description":"When merging nodes during convert, determines what tolerance should be used for deciding two nodes are identical. Units in meters and defaults to 1.0m.",
"maxvalue":"",
"name":"Merge Nearby Nodes Distance",
"defaultvalue":"1.0",
Expand Down
7 changes: 3 additions & 4 deletions docs/HootenannyConfigOptions.asciidoc
Expand Up @@ -77,7 +77,7 @@ Configuration parameters:
[[OGR-Writer]]
==== OGR Writer

The OGR Writer supports advanced translation of OSM formatted files into well defined tabular formats such as Shapefile and FileGDB. See the +--convert-osm2ogr+ documentation for specific examples of how to use the OGR Writer.
The OGR Writer supports advanced translation of OSM formatted files into well defined tabular formats such as Shapefile and FileGDB. See the +--convert+ documentation for specific examples of how to use the OGR Writer.

Configuration Parameters:

Expand All @@ -102,11 +102,10 @@ hoot convert \
PG:"dbname='osm_gis2' host='localhost' port='5432' user='hoot' password='hoottest'"

# Same as above.
hoot convert-osm2ogr \
hoot convert \
-D ogr.writer.pre.layer.name=bar \
test-files/io/SampleTranslation.js \
test-files/io/SampleTranslation.osm \
PG:"dbname='osm_gis2' host='localhost' port='5432' user='hoot' password='hoottest'"
PG:"dbname='osm_gis2' host='localhost' port='5432' user='hoot' password='hoottest'" --trans test-files/io/SampleTranslation.js

# Convert example .osm file and write the resulting layers to a directory full of Shapefiles.
# The directory will be named tmp/MyShapefiles, not tmp/MyShapefiles.shp
Expand Down
10 changes: 2 additions & 8 deletions docs/commands/HootCommandLineReference.asciidoc
Expand Up @@ -10,7 +10,7 @@ The base command line interface follows the following syntax:
hoot (operation) [args...]
-----

Where +operation+ is an operation name such as +convert-ogr2osm+ or +conflate+. The
Where +operation+ is an operation name such as +convert+ or +conflate+. The
parenthesis around +operation+ show that the argument is required.

+[args...]+ shows that there are zero or more arguments to the operation. The
Expand All @@ -26,16 +26,12 @@ include::accuracy-distribution.asciidoc[]
include::attribute-co-occurrence.asciidoc[]
include::attribute-count.asciidoc[]
include::big-cat.asciidoc[]
include::calculate-tiles.asciidoc[]
include::changeset-apply.asciidoc[]
include::changeset-derive.asciidoc[]
include::clean.asciidoc[]
include::conflate.asciidoc[]
include::conflate-differential.asciidoc[]
include::conflate-cumulative.asciidoc[]
include::convert.asciidoc[]
include::convert-ogr2osm.asciidoc[]
include::convert-osm2ogr.asciidoc[]
include::convert-osm2shp.asciidoc[]
include::cookie-cut.asciidoc[]
include::crop.asciidoc[]
include::delete-db-map.asciidoc[]
Expand Down Expand Up @@ -70,8 +66,6 @@ include::score-matches.asciidoc[]
include::sort.asciidoc[]
include::stats.asciidoc[]
include::tag-schema.asciidoc[]
include::tiles-calculate.asciidoc[]
include::tiles-calculate-random.asciidoc[]
include::type-tagger-create-rules.asciidoc[]
include::type-tagger-create-rules-db.asciidoc[]
include::union-polygons.asciidoc[]
Expand Down
60 changes: 60 additions & 0 deletions docs/commands/calculate-tiles.asciidoc
@@ -0,0 +1,60 @@
== calculate-tiles

=== Description

The +tiles-calculate+ command calculates a collection of bounding boxes that contain roughly equal distributions of node data from
the specified input(s) and writes the output to a file.

* +input+ - one or more OSM data inputs; specify multiple inputs by separating them with a semicolon
* +output+ - output file to write the tile boundaries to; valid formats are GeoJSON (*.geojson)
* +maxNodeCountPerTile+ - The maximum number of nodes in any tile. The default is 1000; optional only if pixelSize is not specified
* +pixelSize+ - The size of the pixel used in the calculation in degrees. The default is 0.001; optional only if
maxNodeCountPerTile is not specified
* +random-seed+ - seeds the random number generator for consistent tile boundary selection; valid only if --random is specified;
use -1 for no seeding; defaults to -1
* +--random+ - selects a single random tile from those calculated

If too low a value is specified for maxNodeCountPerTile or too high a value is specified for pixelSize, the algorithm used may not be able
to find a solution.

This command makes use of the optional 'convert.bounding.box' configuration option to determine a subset of the input data to calculate
tiles for. However, 'convert.bounding.box' is only currently supported for OSM API database or Hootenanny API database data sources.
If any other data source is used with the option, this command will return an error.

=== Usage

--------------------------------------
hoot calculate-tiles (input(s)) (output) [maxNodeCountPerTile] [pixelSize] [random-seed] [--random]
--------------------------------------

=== Examples

Calculate tiles based on node density:

--------------------------------------
hoot calculate-tiles test-files/MyInputFile.osm MyOutputFile.geojson
--------------------------------------

Calculate tiles based on node density, specifying the maximum allowed node count per tile and a pixel size:

--------------------------------------
hoot calculate-tiles "test-files/MyInputFile1.osm;test-files/MyInputFile2.osm" MyOutputFile.geojson 1000 0.001
--------------------------------------

Calculate tiles based on node density, narrowing down to a subset of the data specified by a bounding box:

--------------------------------------
hoot calculate-tiles -D convert.bounding.box="34.04,31.17,34.05,31.18" hootapidb://hoot:hoottest@localhost:5432/hoot/MyInputDb MyOutputFile.geojson
--------------------------------------

Select a random tile based on node density:

--------------------------------------
hoot calculate-tiles test-files/MyInputFile.osm MyOutputFile.geojson --random
--------------------------------------

Select a random tile based on node density specifying a particular seed for the random number generator:

--------------------------------------
hoot calculate-tiles test-files/MyInputFile.osm MyOutputFile.geojson 1000 0.001 2 --random
--------------------------------------
32 changes: 0 additions & 32 deletions docs/commands/conflate-differential.asciidoc

This file was deleted.

26 changes: 19 additions & 7 deletions docs/commands/conflate.asciidoc
Expand Up @@ -3,26 +3,38 @@

=== Description

The +conflate+ command conflates two maps into a single map.
The +conflate+ command conflates two maps into a single map. If the specified output file name ends with the extension .osc, an OSM
changeset will be written, instead of an OSM map.

* +input1+ - First input.
* +input2+ - Second input.
* +output+ - The output path.
* +--stats+ - Hootenanny map statistics such as node and way count
* +input1+ - First input (e.g. OSM file).
* +input2+ - Second input (e.g. OSM file, XML changeset file (.osc)).
* +output+ - The output path.
* +--differential+ - Calculates the the differential between two conflation inputs. The output will be all elements in input2 that do
not conflict with any elements in input1.
* +--stats+ - Hootenanny map statistics such as node and way count

=== Usage

--------------------------------------
conflate (input1) [input2] (output) [--stats]
conflate (input1) [input2] (output) [--differential] [--stats]
---------------------------------

==== Example
==== Examples

--------------------------------------
hoot conflate input1.osm input2.osm output.osm --stats
--------------------------------------

--------------------------------------
hoot conflate input1.osm input2.osm output.osm --differential
--------------------------------------

--------------------------------------
hoot conflate input1.osm input2.osm output.osc --differential
--------------------------------------

==== See Also

* _Unifying Conflation_, <<hootalgo,Hootenanny - Algorithms>>
* _Differential Conflation_, <<hootalgo,Hootenanny - Algorithms>>