Example #1
0
        public void GetPolygonsTest()
        {
            var m = new HydroNumerics.MikeSheTools.Core.Model(@"E:\dhi\data\dkm\dk2\result\DK2_v3_gvf_PT_100p_24hr.she");

            var precip = new HydroNumerics.MikeSheTools.DFS.DFS2(m.Input.MIKESHE_FLOWMODEL.Climate.PrecipitationRate.FULLY_DISTRIBUTED.DFS_2D_DATA_FILE.FILE_NAME);

            var actual = XYPolygon.GetPolygons(precip);

            System.Data.DataTable dt = new System.Data.DataTable();
            dt.Columns.Add("ID", typeof(int));

            int k = 0;

            using (HydroNumerics.Geometry.Shapes.ShapeWriter sw = new Geometry.Shapes.ShapeWriter(@"d:\temp\out.shp"))
            {
                for (int i = 0; i < precip.NumberOfColumns; i++)
                {
                    for (int j = 0; j < precip.NumberOfRows; j++)
                    {
                        var drow = dt.NewRow();
                        drow[0] = k;
                        sw.Write(new GeoRefData()
                        {
                            Geometry = actual[i, j], Data = drow
                        });
                        k++;
                    }
                }
            }
        }
Example #2
0
        public void Mike11ObservationsTest()
        {
            Model Mshe = new Model(@"D:\DK_information\M11_omr4-7\XY_M11_detailed\Mike11\DK5_2013_inv.she");
            List <DetailedMike11> actual;

            actual = Mshe.Results.Mike11Observations;

            System.Data.DataTable dt = new System.Data.DataTable();

            dt.Columns.Add("Name", typeof(string));
            dt.Columns.Add("Branch", typeof(string));
            dt.Columns.Add("Chainage", typeof(double));

            using (HydroNumerics.Geometry.Shapes.ShapeWriter sw = new Geometry.Shapes.ShapeWriter(@"d:\temp\detailedm11Points_DK5.shp"))
            {
                foreach (var m11 in actual)
                {
                    var data = dt.NewRow();
                    data[0] = m11.Name;
                    data[1] = m11.Branch;
                    data[2] = m11.Chainage;
                    sw.Write(new Geometry.GeoRefData()
                    {
                        Geometry = m11.Location, Data = data
                    });
                }
            }
        }
Example #3
0
    public void Mike11ObservationsTest()
    {
      Model Mshe = new Model(@"D:\DK_information\M11_omr4-7\XY_M11_detailed\Mike11\DK5_2013_inv.she");
      List<DetailedMike11> actual;
      actual = Mshe.Results.Mike11Observations;

      System.Data.DataTable dt = new System.Data.DataTable();

      dt.Columns.Add("Name", typeof(string));
      dt.Columns.Add("Branch", typeof(string));
      dt.Columns.Add("Chainage", typeof(double));

      using (HydroNumerics.Geometry.Shapes.ShapeWriter sw = new Geometry.Shapes.ShapeWriter(@"d:\temp\detailedm11Points_DK5.shp"))
      {
        foreach (var m11 in actual)
        {
          var data = dt.NewRow();
          data[0]= m11.Name;
          data[1] = m11.Branch;
          data[2]=m11.Chainage;
          sw.Write(new Geometry.GeoRefData() { Geometry = m11.Location, Data = data });
        }
      }
    }