Example #1
0
        static private TrackPoint ReadWayoint(gpxWpt wptType)
        {
            TrackPoint waypoint = new TrackPoint();

            if (wptType.ageofdgpsdataSpecified)
            {
                waypoint.AgeOfGpsData = wptType.ageofdgpsdata;
            }
            waypoint.Comment     = wptType.cmt;
            waypoint.Description = wptType.desc;
            waypoint.DgpsId      = wptType.dgpsid;
            if (wptType.eleSpecified)
            {
                waypoint.Elevation = (double)wptType.ele;
            }
            if (wptType.fixSpecified)
            {
                waypoint.FixType = wptType.fix.ToString();
            }
            if (wptType.geoidheightSpecified)
            {
                waypoint.GeoidHeight = wptType.geoidheight;
            }
            if (wptType.hdopSpecified)
            {
                waypoint.HorizontalDilutionOfPrecision = wptType.hdop;
            }
            waypoint.Location = new Point2 <double> ((double)wptType.lon, (double)wptType.lat);
            if (wptType.magvarSpecified)
            {
                waypoint.MagneticVariation = wptType.magvar;
            }
            waypoint.Name = wptType.name;
            if (wptType.pdopSpecified)
            {
                waypoint.PositionDilutionOfPrecision = wptType.pdop;
            }
            //wptType.sat;
            waypoint.SourceOfData = wptType.src;
            waypoint.Symbol       = wptType.sym;
            if (wptType.timeSpecified)
            {
                waypoint.Time = wptType.time;
            }
            //wptType.type;
            if (wptType.vdopSpecified)
            {
                waypoint.VerticalDilutionOfPrecision = wptType.vdop;
            }
            if (wptType.timeSpecified)
            {
                waypoint.Time = wptType.time;
            }

            return(waypoint);
        }
        private List <IWayPoint> GetRoutePoints()
        {
            int numberOfWaypoints      = _rteType.rtept.Count();
            List <IWayPoint> wayPoints = new List <IWayPoint>(numberOfWaypoints);

            for (int i = 0; i < numberOfWaypoints; i++)
            {
                gpxWpt        wpt         = ConvertRouteWaypint(_rteType.rtept[i]);
                GPX10WayPoint gpxWayPoint = new GPX10WayPoint(wpt);
                wayPoints.Add(gpxWayPoint);
            }
            return(wayPoints);
        }
 private gpxWpt ConvertRouteWaypint(XSD.Ver10.gpxRteRtept routePoint)
 {
     XSD.Ver10.gpxWpt wpt = new gpxWpt();
     wpt.lat                    = routePoint.lat;
     wpt.lon                    = routePoint.lon;
     wpt.ele                    = routePoint.ele;
     wpt.eleSpecified           = routePoint.eleSpecified;
     wpt.ageofdgpsdata          = routePoint.ageofdgpsdata;
     wpt.ageofdgpsdataSpecified = routePoint.ageofdgpsdataSpecified;
     wpt.Any                    = routePoint.Any;
     wpt.cmt                    = routePoint.cmt;
     wpt.desc                   = routePoint.desc;
     wpt.dgpsid                 = routePoint.dgpsid;
     wpt.fix                    = routePoint.fix;
     wpt.fixSpecified           = routePoint.fixSpecified;
     wpt.geoidheight            = routePoint.geoidheight;
     wpt.geoidheightSpecified   = routePoint.geoidheightSpecified;
     wpt.hdop                   = routePoint.hdop;
     wpt.hdopSpecified          = routePoint.hdopSpecified;
     wpt.magvar                 = routePoint.magvar;
     wpt.magvarSpecified        = routePoint.magvarSpecified;
     wpt.name                   = routePoint.name;
     wpt.pdop                   = routePoint.pdop;
     wpt.pdopSpecified          = routePoint.pdopSpecified;
     wpt.sat                    = routePoint.sat;
     wpt.src                    = routePoint.src;
     wpt.sym                    = routePoint.sym;
     wpt.time                   = routePoint.time;
     wpt.timeSpecified          = routePoint.timeSpecified;
     wpt.type                   = routePoint.type;
     wpt.url                    = routePoint.url;
     wpt.urlname                = routePoint.urlname;
     wpt.vdop                   = routePoint.vdop;
     wpt.vdopSpecified          = routePoint.vdopSpecified;
     return(wpt);
 }
 private gpxWpt ConvertToWayPoint(XSD.Ver10.gpxTrkTrksegTrkpt trackSegmentWaypoint)
 {
     XSD.Ver10.gpxWpt wpt = new gpxWpt();
     wpt.lat                    = trackSegmentWaypoint.lat;
     wpt.lon                    = trackSegmentWaypoint.lon;
     wpt.ele                    = trackSegmentWaypoint.ele;
     wpt.eleSpecified           = trackSegmentWaypoint.eleSpecified;
     wpt.ageofdgpsdata          = trackSegmentWaypoint.ageofdgpsdata;
     wpt.ageofdgpsdataSpecified = trackSegmentWaypoint.ageofdgpsdataSpecified;
     wpt.Any                    = trackSegmentWaypoint.Any;
     wpt.cmt                    = trackSegmentWaypoint.cmt;
     wpt.desc                   = trackSegmentWaypoint.desc;
     wpt.dgpsid                 = trackSegmentWaypoint.dgpsid;
     wpt.fix                    = trackSegmentWaypoint.fix;
     wpt.fixSpecified           = trackSegmentWaypoint.fixSpecified;
     wpt.geoidheight            = trackSegmentWaypoint.geoidheight;
     wpt.geoidheightSpecified   = trackSegmentWaypoint.geoidheightSpecified;
     wpt.hdop                   = trackSegmentWaypoint.hdop;
     wpt.hdopSpecified          = trackSegmentWaypoint.hdopSpecified;
     wpt.magvar                 = trackSegmentWaypoint.magvar;
     wpt.magvarSpecified        = trackSegmentWaypoint.magvarSpecified;
     wpt.name                   = trackSegmentWaypoint.name;
     wpt.pdop                   = trackSegmentWaypoint.pdop;
     wpt.pdopSpecified          = trackSegmentWaypoint.pdopSpecified;
     wpt.sat                    = trackSegmentWaypoint.sat;
     wpt.src                    = trackSegmentWaypoint.src;
     wpt.sym                    = trackSegmentWaypoint.sym;
     wpt.time                   = trackSegmentWaypoint.time;
     wpt.timeSpecified          = trackSegmentWaypoint.timeSpecified;
     wpt.type                   = trackSegmentWaypoint.type;
     wpt.url                    = trackSegmentWaypoint.url;
     wpt.urlname                = trackSegmentWaypoint.urlname;
     wpt.vdop                   = trackSegmentWaypoint.vdop;
     wpt.vdopSpecified          = trackSegmentWaypoint.vdopSpecified;
     return(wpt);
 }
Example #5
0
        private static TrackPoint ReadWayoint(gpxWpt wptType)
        {
            TrackPoint waypoint = new TrackPoint ();

            if (wptType.ageofdgpsdataSpecified)
                waypoint.AgeOfGpsData = wptType.ageofdgpsdata;
            waypoint.Comment = wptType.cmt;
            waypoint.Description = wptType.desc;
            waypoint.DgpsId = wptType.dgpsid;
            if (wptType.eleSpecified)
                waypoint.Elevation = (double)wptType.ele;
            if (wptType.fixSpecified)
                waypoint.FixType = wptType.fix.ToString ();
            if (wptType.geoidheightSpecified)
                waypoint.GeoidHeight = wptType.geoidheight;
            if (wptType.hdopSpecified)
                waypoint.HorizontalDilutionOfPrecision = wptType.hdop;
            waypoint.Location = new Point2<double> ((double)wptType.lon, (double)wptType.lat);
            if (wptType.magvarSpecified)
                waypoint.MagneticVariation = wptType.magvar;
            waypoint.Name = wptType.name;
            if (wptType.pdopSpecified)
                waypoint.PositionDilutionOfPrecision = wptType.pdop;
            //wptType.sat;
            waypoint.SourceOfData = wptType.src;
            waypoint.Symbol = wptType.sym;
            if (wptType.timeSpecified)
                waypoint.Time = wptType.time;
            //wptType.type;
            if (wptType.vdopSpecified)
                waypoint.VerticalDilutionOfPrecision = wptType.vdop;
            if (wptType.timeSpecified)
                waypoint.Time = wptType.time;

            return waypoint;
        }