示例#1
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object can be used to retrieve data from input parameters and
        /// to store data in output parameters.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Get the Rhino Units to properly scale the lat/lon data into Rhino units
            double unitScale = CommonGHProcessors.GetRhinoUnitScale(Rhino.RhinoDoc.ActiveDoc);

            List <OSMPointData> outPoints = new List <OSMPointData>();
            List <OSMPoint>     osmPoints = new List <OSMPoint>();

            LINE.Geometry.Interval2d latlon = new LINE.Geometry.Interval2d();
            string   dataStream             = string.Empty;
            Interval latDomain = new Interval();
            Interval lonDomain = new Interval();

            string path = null;

            DA.GetData(0, ref path);
            if (path != null && System.IO.File.Exists(path))
            {
                ElkLib.NodePreProcess(path, unitScale, out dataStream, out osmPoints, out latlon);
                foreach (OSMPoint op in osmPoints)
                {
                    OSMPointData od = new OSMPointData(op);
                    outPoints.Add(od);
                }
            }

            lonDomain = new Interval(latlon.UMin, latlon.UMax);
            latDomain = new Interval(latlon.VMin, latlon.VMax);

            // Output the data
            DA.SetDataList(0, outPoints);
            DA.SetData(1, path);
            DA.SetData(2, lonDomain);
            DA.SetData(3, latDomain);
        }
示例#2
0
 public OSMPointData(OSMPointData osmSource)
 {
     this.Value = osmSource.Value;
 }