/// <summary> /// /// </summary> /// <param name="node"></param> /// <param name="addEnv"></param> /// <returns></returns> public static Node CreateExpanded(Node node, IEnvelope addEnv) { IEnvelope expandEnv = new Envelope(addEnv); if (node != null) expandEnv.ExpandToInclude(node.env); Node largerNode = CreateNode(expandEnv); if (node != null) largerNode.InsertNode(node); return largerNode; }
/// <summary> /// Transforms a <see cref="Envelope"/>. /// </summary> /// <param name="box">BoundingBox to transform</param> /// <param name="transform">Math Transform</param> /// <returns>Transformed object</returns> public static IEnvelope TransformBox(IEnvelope box, IMathTransform transform) { if (box == null) return null; double[][] corners = new double[4][]; corners[0] = transform.Transform(ToLightStruct(box.MinX, box.MinY)); //LL corners[1] = transform.Transform(ToLightStruct(box.MaxX, box.MaxY)); //UR corners[2] = transform.Transform(ToLightStruct(box.MinX, box.MaxY)); //UL corners[3] = transform.Transform(ToLightStruct(box.MaxX, box.MinY)); //LR IEnvelope result = new Envelope(); foreach (double[] p in corners) result.ExpandToInclude(p[0], p[1]); return result; }
/// <summary> /// /// </summary> /// <returns></returns> protected override IEnvelope ComputeEnvelopeInternal() { IEnvelope envelope = new Envelope(); for (int i = 0; i < geometries.Length; i++) envelope.ExpandToInclude(geometries[i].EnvelopeInternal); return envelope; }