Example #1
0
        /// <summary>
        /// Reproject the src bounding box into the destination coordinate system
        /// </summary>
        /// <param name="hSrcBB"></param>
        /// <param name="hDestCS"></param>
        /// <returns></returns>
        static internal bool Reproject(Geosoft.Dap.Common.BoundingBox hSrcBB, Geosoft.Dap.Common.CoordinateSystem hDestCS)
        {
#if !DAPPLE
            Geosoft.GXNet.CIPJ hSrcIPJ  = null;
            Geosoft.GXNet.CIPJ hDestIPJ = null;

            try
            {
                hSrcIPJ  = Geosoft.GXNet.CIPJ.Create();
                hDestIPJ = Geosoft.GXNet.CIPJ.Create();

                hSrcIPJ.SetGXF("", hSrcBB.CoordinateSystem.Datum, hSrcBB.CoordinateSystem.Method, hSrcBB.CoordinateSystem.Units, hSrcBB.CoordinateSystem.LocalDatum);
                hDestIPJ.SetGXF("", hDestCS.Datum, hDestCS.Method, hDestCS.Units, hDestCS.LocalDatum);

                return(Reproject(hSrcBB, hSrcIPJ, hDestIPJ));
            }
            catch (Exception e)
            {
                GetDapError.Instance.Write("Reproject - " + e.Message);
            }
            finally
            {
                if (hSrcIPJ != null)
                {
                    hSrcIPJ.Dispose();
                }
                if (hDestIPJ != null)
                {
                    hDestIPJ.Dispose();
                }
            }
#endif
            return(false);
        }
Example #2
0
        /// <summary>
        /// Reproject the src bounding box into the destination coordinate system
        /// </summary>
        /// <param name="hSrcBB"></param>
        /// <param name="hDestCS"></param>
        /// <returns></returns>
        static internal bool Reproject(Geosoft.Dap.Common.BoundingBox hSrcBB, Geosoft.GXNet.CIPJ ipDestIPJ)
        {
            Geosoft.GXNet.CIPJ ipSrcIPJ = null;

            try {
                ipSrcIPJ = Geosoft.GXNet.CIPJ.Create();

                ipSrcIPJ.SetGXF("", hSrcBB.CoordinateSystem.Datum, hSrcBB.CoordinateSystem.Method, hSrcBB.CoordinateSystem.Units, hSrcBB.CoordinateSystem.LocalDatum);

                return(Reproject(hSrcBB, ipSrcIPJ, ipDestIPJ));
            } catch (Exception e) {
                GetDapError.Instance.Write("Reproject - " + e.Message);
            } finally {
                if (ipSrcIPJ != null)
                {
                    ipSrcIPJ.Dispose();
                }
            }
            return(false);
        }