-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests and documentation for intersection clustering.
Changed type HighwayCluster to HighwaySet. Intersection clustering requires nodes to be in ENU coordinates. Issue #31. Signed-off-by: Ted Steiner <tsteiner2@gmail.com>
- Loading branch information
1 parent
d8e363e
commit 371b68f
Showing
7 changed files
with
64 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Test intersection detection and clustering | ||
|
||
module TestIntersections | ||
|
||
using OpenStreetMap | ||
using Base.Test | ||
using Compat | ||
|
||
import OpenStreetMap: Bounds, centerBounds | ||
|
||
MAP_FILENAME = "tech_square.osm" | ||
|
||
bounds = Bounds(42.3637, 42.3655, -71.0919, -71.0893) | ||
|
||
bounds_ENU = lla2enu(bounds) | ||
|
||
nodesLLA, hwys, builds, feats = getOSMData(MAP_FILENAME) | ||
nodes = lla2enu(nodesLLA,centerBounds(bounds)) | ||
|
||
# Find intersections in map | ||
intersections = findIntersections(hwys) | ||
@test length(intersections) == 91 | ||
|
||
# Find Highway Sets | ||
highway_sets = findHighwaySets(hwys) | ||
@test length(highway_sets) == 4 | ||
|
||
# Cluster intersections | ||
intersection_cluster_mapping, intersection_cluster_nodes = findIntersectionClusters(nodes,intersections,highway_sets,max_dist=15) | ||
replaceHighwayNodes!(hwys,intersection_cluster_mapping) | ||
intersections_clustered = findIntersections(hwys) | ||
@test length(intersections_clustered) == 82 | ||
|
||
end # module TestIntersections | ||
|
||
|
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ tests = [ | |
"crop_map", | ||
"classes", | ||
"coordinates", | ||
"intersections", | ||
"routes", | ||
"plots" ] | ||
|
||
|