Exemple #1
0
        public virtual EnvelopeCoords GetEnvelopeCoord()
        {
            Coordinate gpc  = new Coordinate();
            double     xmax = -1E+256;
            double     xmin = 1E+256;
            double     ymax = -1E+256;
            double     ymin = 1E+256;

            foreach (string mypoint in ShapePointList)
            {
                gpc  = GlobalPointCoordinate(mypoint);
                xmax = (xmax > gpc.x) ? xmax : gpc.x;
                xmin = (xmin < gpc.x) ? xmin : gpc.x;
                ymax = (ymax > gpc.y) ? ymax : gpc.y;
                ymin = (ymin < gpc.y) ? ymin : gpc.y;
            }

            EnvelopeCoords Ecoords = new EnvelopeCoords();

            Ecoords.Max = new Coordinate {
                x = xmax, y = ymax
            };
            Ecoords.Min = new Coordinate {
                x = xmin, y = ymin
            };

            return(Ecoords);
        }
Exemple #2
0
            public override EnvelopeCoords GetEnvelopeCoord()
            {
                //Override bc if phi > 180 then the tops of the arc aren't accounted for
                Coordinate gpc  = new Coordinate();
                double     xmax = -1E+256;
                double     xmin = 1E+256;
                double     ymax = -1E+256;
                double     ymin = 1E+256;

                foreach (string mypoint in ShapePointList)
                {
                    if (mypoint != "a" || mypoint != "j") // points a and j are not actually on the shape
                    {
                        gpc  = GlobalPointCoordinate(mypoint);
                        xmax = (xmax > gpc.x) ? xmax : gpc.x;
                        xmin = (xmin < gpc.x) ? xmin : gpc.x;
                        ymax = (ymax > gpc.y) ? ymax : gpc.y;
                        ymin = (ymin < gpc.y) ? ymin : gpc.y;
                    }
                }

                Coordinate gpc_a = GlobalPointCoordinate("a");

                if (phi >= Math.PI)
                {
                    xmax = gpc_a.x + _R;
                    ymax = gpc_a.y + _R;
                    xmin = gpc_a.x - _R;
                    ymin = gpc_a.y - _R;
                }

                EnvelopeCoords Ecoords = new EnvelopeCoords();

                Ecoords.Max = new Coordinate {
                    x = xmax, y = ymax
                };
                Ecoords.Min = new Coordinate {
                    x = xmin, y = ymin
                };

                return(Ecoords);
            }
Exemple #3
0
        public EnvelopeCoords GetEnvelopeCoord()
        {
            double xmin = 1E+256;
            double xmax = -1E+256;
            double ymin = 1E+256;
            double ymax = -1E+256;

            EnvelopeCoords Ecoords;

            foreach (IShape shape in ShapeList)
            {
                Ecoords = shape.GetEnvelopeCoord();

                xmin = (Ecoords.Min.x < xmin) ? Ecoords.Min.x : xmin;
                xmax = (Ecoords.Max.x > xmax) ? Ecoords.Max.x : xmax;
                ymin = (Ecoords.Min.y < ymin) ? Ecoords.Min.y : ymin;
                ymax = (Ecoords.Max.y > ymax) ? Ecoords.Max.y : ymax;
            }

            EnvelopeCoords env = new EnvelopeCoords();

            Coordinate xyMax = new Coordinate();

            xyMax.x = xmax;
            xyMax.y = ymax;

            Coordinate xyMin = new Coordinate();

            xyMin.x = xmin;
            xyMin.y = ymin;

            env.Max = xyMax;
            env.Min = xyMin;

            return(env);
        }