bug in function TransformBox?

Jan 9, 2012 at 6:57 AM

My prolem is transform local shp file to google map, I query data with MapQueried but output many results than actual result

I found problem this function

 public static BoundingBox TransformBox(BoundingBox box, IMathTransform transform)
            if (box == null)
                return null;
            Point[] corners = new Point[4];
            var ll = box.Min.ToDoubleArray();
            var ur = box.Max.ToDoubleArray();
            var llTrans = transform.Transform(ll);
            var urTrans = transform.Transform(ur);
            corners[0] = new Point(llTrans); //LL
            corners[1] = new Point(urTrans); //UR
            corners[2] = new Point(llTrans[0], urTrans[1]); //UL
            //corners[3] = new Point(llTrans[1], urTrans[0]); //LR
            corners[3] = new Point(urTrans[0],llTrans[1]); //LR
            BoundingBox result = corners[0].GetBoundingBox();
            for (int i = 1; i < 4; i++)
                result = result.Join(corners[i].GetBoundingBox());
            return result;

Jan 9, 2012 at 11:10 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.