private void CreatePoints(
           IFeatureSet shapeLayer, int idField)
        {
            this.npoints1 = shapeLayer.NumRows();
            this.cpoints1 = new double[this.npoints1, 7];//x,y,z,z-inter,error,stderr
            this.quadTree1 = new QuadTree();

            for (int shp = 0; shp < shapeLayer.NumRows(); shp++)
            {
                Coordinate pt = shapeLayer.Features[shp].Coordinates[0];
                this.cpoints1[shp, 0] = pt.X;
                this.cpoints1[shp, 1] = pt.Y;
                this.cpoints1[shp, 6] = pt.Z;
                this.cpoints1[shp, 2] = Convert.ToDouble(shapeLayer.Features[shp].DataRow[idField]);
               // this.quadTree1.Insert(pt.X, pt.Y, shp);


                if (this.cpoints1[shp, 6] > this.extentZ1[1])
                {
                    this.extentZ1[1] = this.cpoints1[shp, 2];
                }

                if (this.cpoints1[shp, 2] > this.extentZ1[1])
                {
                    this.extentZ1[1] = this.cpoints1[shp, 2];
                }
                if (this.cpoints1[shp, 2] < this.extentZ1[0])
                {
                    this.extentZ1[0] = this.cpoints1[shp, 2];
                }
                //xmin ymin xmax ymax
                //xmin ymin zmin xmax ymax zmax
                if (pt.Z > this.extent1[5])
                {
                    this.extent1[5] = pt.Z;
                }

                if (pt.Y > this.extent1[4])
                {
                    this.extent1[4] = pt.Y;
                }

                if (pt.X > this.extent1[3])
                {
                    this.extent1[3] = pt.X;
                }

                if (pt.X < this.extent1[0])
                {
                    this.extent1[0] = pt.X;
                }

                if (pt.Y < this.extent1[1])
                {
                    this.extent1[1] = pt.Y;
                }
            }
            

        }
Exemple #2
0
        public SearchData(List<Kpoint> points, QuadTree quadTree,double[] extent)

        {
            this.quadTreeValues = quadTree;
            this.kpoints = points;
            this.minPointsPerSector = 2;
            this.maxPointsPerSector = 5;
            this.Type = 1;
            this.InitialDistanceSearch = (extent[3] - extent[0]) * 0.5;
            this.majorRadio = initialDistanceSearch;
            this.minorRadio = initialDistanceSearch;
        }
        private void CreatePointsK(
          IFeatureSet shapeLayer, int idField)
        {
            this.data = shapeLayer;
            this.npoints1 = shapeLayer.NumRows();
           // this.kpoints = new Kpoint[this.npoints1];//x,y,z,z-inter,error,stderr
            this.quadTree1 = new QuadTree();
            Stat NorthSouth = new Stat(false);
            Stat EastWest = new Stat(false); 
            Stat TopBott = new Stat(false);
            Stat Zvalue = new Stat(false);
            List<int> l = SelectRandom(shapeLayer.NumRows());
            this.npoints1 = l.Count();

            for (int shp1 = 0; shp1 < l.Count; shp1++)
            {
                int shp = l[shp1];
                Coordinate pt = shapeLayer.Features[shp].Coordinates[0];
                Kpoint point = new Kpoint(pt.X, pt.Y, double.IsNaN(pt.Z) ? 0 : pt.Z, Convert.ToDouble(shapeLayer.Features[shp].DataRow[idField]), shp);
                this.kpoints.Add(point );
                //this.cpoints1[shp, 0] = pt.X;
                //this.cpoints1[shp, 1] = pt.Y;
                //this.cpoints1[shp, 2] = Convert.ToDouble(shapeLayer.Features[shp].DataRow[idField]);
                this.quadTree1.Insert(pt.X, pt.Y, point);
                NorthSouth += new Stat(pt.Y);
                EastWest += new Stat(pt.X);
                TopBott += new Stat(pt.Z);
                Zvalue +=  new Stat(point.W);
            }
                this.extentZ1= new  double[2] {Zvalue.Min,Zvalue.Max};
                this.extent1= new  double[6]{EastWest.Min,NorthSouth.Min,TopBott.Min,EastWest.Max,NorthSouth.Max, TopBott.Max};
                this.idExtremPoints= new long[6]{EastWest.PosMin,NorthSouth.PosMin,TopBott.PosMin,EastWest.PosMax,NorthSouth.PosMax, TopBott.PosMax};
                this.idExtremeZPoints= new long[2]{Zvalue.PosMin,Zvalue.PosMax};
        }