-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add some test scripts for nodejs calls to hoot merge * make executable * This commit will fix an issue that was occuring when the script scripts/core/MergeNodes.js is executed from within the translations directory. In particular, ConfPath::search(...) was looking in the local directory, before checking the specified searchDir. This was a problem for script execution in the translations dir, because translations contains a Poi.js file collides with the (proper) rules/Poi.js file * update tests so assertions actually invoked adds two tests that are currently failing will pass when #5289 is fixed * MergeElements Update * Fix HootExceptionJs to allow detailed error messages to bubble up to Node, instead of just always reporting "UnsupportedException" * Update copyright headers * handle some hoot settings bleeding over from other test runs * this seems like a typo * format the new HootJS exception better in the http response Co-authored-by: Brian Hatchl <[email protected]> Co-authored-by: Micah Schicker <[email protected]> Co-authored-by: Ben Marchant <[email protected]>
- Loading branch information
1 parent
194e294
commit 130fc8d
Showing
10 changed files
with
319 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/node | ||
|
||
var HOOT_HOME = process.env.HOOT_HOME | ||
var hoot = require(HOOT_HOME + '/lib/HootJs'); | ||
hoot.Log.setLogLevel('debug'); | ||
|
||
var data = '<?xml version="1.0" encoding="UTF-8"?>\ | ||
<osm version="0.6" upload="true" generator="hootenanny">\ | ||
<node id="-1559816" lon="-104.71755649299132" lat="38.888511927381124" version="1">\ | ||
<tag k="amenity" v="cafe" />\ | ||
<tag k="error:circular" v="1000" />\ | ||
<tag k="hoot:status" v="Input1" />\ | ||
<tag k="name" v="Starbucks" />\ | ||
<tag k="note" v="1-c" />\ | ||
<tag k="poi" v="yes" />\ | ||
<tag k="hoot:merge:target" v="yes" />\ | ||
</node>\ | ||
<node id="-1559910" lon="-104.71877032224545" lat="38.88870088854899" version="1">\ | ||
<tag k="amenity" v="cafe" />\ | ||
<tag k="error:circular" v="1000" />\ | ||
<tag k="hoot:status" v="Input2" />\ | ||
<tag k="name" v="Starbucks" />\ | ||
<tag k="note" v="2-c" />\ | ||
<tag k="poi" v="yes" />\ | ||
</node>\ | ||
</osm>'; | ||
var map = new hoot.OsmMap(); | ||
hoot.loadMapFromStringPreserveIdAndStatus(map, data); | ||
var mergedMap = hoot.merge(map); | ||
var mergedMapStr = hoot.OsmWriter.toString(mergedMap); | ||
console.log("\n\nOutput:\n\n" + mergedMapStr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.