Exemplo n.º 1
0
    public Street(Intersection from, Intersection to, OSMWay way, OSMData osm, Polyline pathway)
    {
        this.from = from;
        this.to   = to;
        this.way  = way;
        //this.osm = osm;

        //Creation of the pathway is handled outside (by bridge)
        this.pathway = pathway;
        centerLine   = new Polyline(pathway.Vertices);


        //Needs centerLine, therefore after that
        from.AddStreet(this);
        to.AddStreet(this);

        /*Default is oneway=no, except for highway=motorway which implies oneway=yes. junction=roundabout also implies oneway=yes. highway=motorway_link has been a discussion a few times before, and it's best to add the oneway=* tag on those all the time, one way or not. --Eimai 12:59, 8 January 2009 (UTC)
         * Should this be indicated in the page? --Seav 10:49, 14 January 2009 (UTC)
         * Other implicit oneway=yes cases are: highway=motorway_link, highway=trunk_link and highway=primary_link. --Beldin 21:55, 22 April 2009 (UTC)*/

        if (way.Tags.ContainsKey("oneway"))
        {
            if (way.Tags["oneway"] == "yes" || way.Tags["oneway"] == "1" || way.Tags["oneway"] == "true")
            {
                isOneWay = true;
            }
        }
        if (way.Tags.ContainsKey("highway"))
        {
            if (way.Tags["highway"] == "motorway")
            {
                isOneWay = true;
            }
        }
        if (way.Tags.ContainsKey("junction"))
        {
            if (way.Tags["junction"] == "roundabout")
            {
                isOneWay = true;
            }
        }

        if (isOneWay)
        {
            carriageways[0] = new CarriageWay(way);
        }
        else
        {
            carriageways[0] = new CarriageWay(way);
            carriageways[1] = new CarriageWay(way);
        }
    }
Exemplo n.º 2
0
    public Street(Intersection from, Intersection to, OSMWay way, OSMData osm)
    {
        this.from = from;
        this.to   = to;
        this.way  = way;
        //this.osm = osm;

        OSMNode node;

        pathway = new Polyline();

        foreach (long nodeId in way.GetWayNodesFromTo(from, to))
        {
            if (osm.nodes.TryGetValue(nodeId, out node))
            {
                pathway.Add(new Vertex(node + Vector3.up * 0.1f));
            }
        }

        centerLine = new Polyline(pathway.Vertices);


        //Needs centerLine, therefore after that
        from.AddStreet(this);
        to.AddStreet(this);

        /*Default is oneway=no, except for highway=motorway which implies oneway=yes. junction=roundabout also implies oneway=yes. highway=motorway_link has been a discussion a few times before, and it's best to add the oneway=* tag on those all the time, one way or not. --Eimai 12:59, 8 January 2009 (UTC)
         * Should this be indicated in the page? --Seav 10:49, 14 January 2009 (UTC)
         * Other implicit oneway=yes cases are: highway=motorway_link, highway=trunk_link and highway=primary_link. --Beldin 21:55, 22 April 2009 (UTC)*/


        if (way.Tags.ContainsKey("oneway"))
        {
            if (way.Tags["oneway"] == "yes" || way.Tags["oneway"] == "1" || way.Tags["oneway"] == "true")
            {
                isOneWay = true;
            }
        }
        if (way.Tags.ContainsKey("highway"))
        {
            if (way.Tags["highway"] == "motorway")
            {
                isOneWay = true;
            }
        }
        if (way.Tags.ContainsKey("junction"))
        {
            if (way.Tags["junction"] == "roundabout")
            {
                isOneWay = true;
            }
        }

        if (isOneWay)
        {
            carriageways[0] = new CarriageWay(way);
        }
        else
        {
            carriageways[0] = new CarriageWay(way);
            carriageways[1] = new CarriageWay(way);
        }
    }