コード例 #1
0
ファイル: test.py プロジェクト: returnzero23/osm2xodr
def test_simple3WayoneWayLaneTCrossingOpposite():
    nodes = [
        TestEntity(1, None, lon=1, lat=1, nodes=0),
        TestEntity(2, None, lon=1, lat=2, nodes=0),
        TestEntity(3, None, lon=2, lat=2, nodes=0),
        TestEntity(4, None, lon=0, lat=2, nodes=0)
    ]
    ways = [
        TestEntity(1, {
            "highway": "residential",
            "lanes": "2",
            "oneway": "yes"
        },
                   nodes=[2, 1]),
        TestEntity(2, {
            "highway": "residential",
            "lanes": "2",
            "turn:lanes:forward": "through"
        },
                   nodes=[2, 3]),
        TestEntity(3, {
            "highway": "residential",
            "lanes": "2",
            "turn:lanes:forward": "through"
        },
                   nodes=[2, 4])
    ]
    _test_nodes(nodes, ways)
コード例 #2
0
ファイル: test.py プロジェクト: returnzero23/osm2xodr
def test_3WayTCrossing2():
    nodes = [
        TestEntity(1, None, lon=1, lat=1, nodes=0),
        TestEntity(2, None, lon=1, lat=1.001, nodes=0),
        TestEntity(3, None, lon=1.001, lat=1.001, nodes=0),
        TestEntity(4, None, lon=0.999, lat=1.001, nodes=0)
    ]
    ways = [
        TestEntity(1, {
            "highway": "residential",
            "lanes": "3",
            "lanes:forward": "2",
            "lanes:backward": "1",
            "oneway": "no"
        },
                   nodes=[1, 2]),
        TestEntity(2, {
            "highway": "residential",
            "lanes": "3",
            "lanes:forward": "2",
            "lanes:backward": "1",
            "oneway": "no"
        },
                   nodes=[2, 3]),
        TestEntity(3, {
            "highway": "residential",
            "lanes": "3",
            "lanes:forward": "2",
            "lanes:backward": "1",
            "oneway": "no"
        },
                   nodes=[2, 4])
    ]
    _test_nodes(nodes, ways)
コード例 #3
0
ファイル: test.py プロジェクト: returnzero23/osm2xodr
def test_2WayTCrossing4():
    nodes = [
        TestEntity(1, None, lon=1, lat=1, nodes=0),
        TestEntity(2, None, lon=1, lat=1.001, nodes=0),
        TestEntity(3, None, lon=1.001, lat=1.001, nodes=0)
    ]
    ways = [
        TestEntity(1, {
            "highway": "residential",
            "lanes": "5",
            "lanes:forward": "2",
            "lanes:backward": "3",
            "oneway": "no"
        },
                   nodes=[1, 2]),
        TestEntity(2, {
            "highway": "residential",
            "lanes": "5",
            "lanes:forward": "3",
            "lanes:backward": "2",
            "oneway": "no"
        },
                   nodes=[3, 2])
    ]
    _test_nodes(nodes, ways)
コード例 #4
0
ファイル: test.py プロジェクト: returnzero23/osm2xodr
def testSimpleRoad():
    nodes = [
        TestEntity(1, None, lon=1, lat=1, nodes=0),
        TestEntity(2, None, lon=1, lat=1.001, nodes=0),
        TestEntity(3, None, lon=1.001, lat=1.002, nodes=0),
        TestEntity(4, None, lon=1.001, lat=1.003, nodes=0)
    ]
    ways = [
        TestEntity(1, {
            "highway": "residential",
            "lanes": "5",
            "lanes:forward": "3",
            "lanes:backward": "2",
            "oneway": "no"
        },
                   nodes=[1, 2, 3, 4])
    ]
    _test_nodes(nodes, ways)
コード例 #5
0
ファイル: test.py プロジェクト: returnzero23/osm2xodr
def test_merge3to2():
    nodes = [
        TestEntity(1, None, lon=1, lat=1, nodes=0),
        TestEntity(2, None, lon=1, lat=2, nodes=0),
        TestEntity(3, None, lon=2, lat=2, nodes=0)
    ]
    ways = [
        TestEntity(1, {
            "highway": "residential",
            "lanes": "4",
            "lanes:forward": "3"
        },
                   nodes=[1, 2]),
        TestEntity(2, {
            "highway": "residential",
            "lanes": "3",
            "lanes:forward": "2"
        },
                   nodes=[2, 3])
    ]
    _test_nodes(nodes, ways)