Ejemplo n.º 1
0
 internal DapDownload(string imagePath, Geosoft.Dap.Common.BoundingBox hBB, DAPImageStore imageStore)
     : base()
 {
     m_hBB = hBB;
     m_oImageStore = imageStore;
     Url = imageStore.Server.Url;
 }
Ejemplo n.º 2
0
 internal ArcIMSImageDownload(ArcIMSImageStore oImageStore, Geosoft.Dap.Common.BoundingBox oEnvelope, int iIndexNumber, CultureInfo oInfo, double dArtificialZoom)
     : base(oImageStore.ServerUri, iIndexNumber)
 {
     m_oCultureInfo = oInfo;
     m_oImageStore = oImageStore;
      m_oEnvelope = oEnvelope;
     m_dArtificialZoom = dArtificialZoom;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Create a coordinate system from an ipj and a bounding box
        /// </summary>
        /// <param name="dMinX"></param>
        /// <param name="dMinY"></param>
        /// <param name="dMinZ"></param>      
        /// <param name="dMaxX"></param>
        /// <param name="dMaxY"></param>
        /// <param name="dMaxZ"></param>
        /// <param name="hIPJ"></param>
        /// <returns></returns>
        internal static Geosoft.Dap.Common.BoundingBox SetCoordinateSystem(double dMinX, double dMinY, double dMinZ, double dMaxX, double dMaxY, double dMaxZ, Geosoft.GXNet.CIPJ hIPJ)
        {
            Geosoft.Dap.Common.BoundingBox   hBoundingBox = null;
             string                           strProjectionName = string.Empty;
             string                           strDatum = string.Empty;
             string                           strProjection = string.Empty;
             string                           strUnits = string.Empty;
             string                           strLocalDatum = string.Empty;

             hIPJ.IGetGXF(ref strProjectionName, ref strDatum, ref strProjection, ref strUnits, ref strLocalDatum);

             hBoundingBox = new Geosoft.Dap.Common.BoundingBox(dMaxX, dMaxY, dMaxZ, dMinX, dMinY, dMinZ);
             hBoundingBox.CoordinateSystem = new Geosoft.Dap.Common.CoordinateSystem();
             hBoundingBox.CoordinateSystem.Projection = strProjectionName;
             hBoundingBox.CoordinateSystem.Datum = strDatum;
             hBoundingBox.CoordinateSystem.Method = strProjection;
             hBoundingBox.CoordinateSystem.Units = strUnits;
             hBoundingBox.CoordinateSystem.LocalDatum = strLocalDatum;
             return hBoundingBox;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Reproject the src bounding box into the destination coordinate system
        /// </summary>
        /// <param name="hSrcBB"></param>
        /// <param name="hDestCS"></param>
        /// <returns></returns>
        internal static bool Reproject(Geosoft.Dap.Common.BoundingBox hSrcBB, Geosoft.GXNet.CIPJ ipSrcIPJ, Geosoft.GXNet.CIPJ ipDestIPJ)
        {
            Geosoft.GXNet.CPJ    hPJ = null;

             double               dMinX;
             double               dMinY;
             double               dMaxX;
             double               dMaxY;

             String               strProjectionName = String.Empty;
             String               strDatum = String.Empty;
             String               strProjection = String.Empty;
             String               strUnits = String.Empty;
             String               strLocalDatum = String.Empty;

             // --- All dummies therefore will be dummies in new coordinate sytem as well ---

             if (hSrcBB.MinX == Geosoft.GXNet.Constant.rDUMMY ||
            hSrcBB.MinY == Geosoft.GXNet.Constant.rDUMMY ||
            hSrcBB.MaxX == Geosoft.GXNet.Constant.rDUMMY ||
            hSrcBB.MaxY == Geosoft.GXNet.Constant.rDUMMY)
             {
            return true;
             }

             try
             {
            // --- check to see if this is a valid coordinate system for the given coordinates ---

            hPJ = Geosoft.GXNet.CPJ.CreateIPJ(ipSrcIPJ, ipDestIPJ);
            dMinX = hSrcBB.MinX;
            dMinY = hSrcBB.MinY;
            dMaxX = hSrcBB.MaxX;
            dMaxY = hSrcBB.MaxY;

            hPJ.ProjectBoundingRectangle(ref dMinX, ref dMinY, ref dMaxX, ref dMaxY);

            if (dMinX == Geosoft.GXNet.Constant.rDUMMY ||
               dMinY == Geosoft.GXNet.Constant.rDUMMY ||
               dMaxX == Geosoft.GXNet.Constant.rDUMMY ||
               dMaxY == Geosoft.GXNet.Constant.rDUMMY)
            {
               return false; // --- unable to convert to the desired coordinate system ---
            }

            // --- copy new projection into src bounding box ---

            ipDestIPJ.IGetName(Geosoft.GXNet.Constant.IPJ_NAME_PCS, ref strProjectionName);
            ipDestIPJ.IGetName(Geosoft.GXNet.Constant.IPJ_NAME_DATUM, ref strDatum);
            ipDestIPJ.IGetName(Geosoft.GXNet.Constant.IPJ_NAME_PROJECTION, ref strProjection);
            ipDestIPJ.IGetName(Geosoft.GXNet.Constant.IPJ_NAME_LDATUM, ref strLocalDatum);
            ipDestIPJ.IGetName(Geosoft.GXNet.Constant.IPJ_NAME_UNIT_ABBR, ref strUnits);

            hSrcBB.CoordinateSystem.Projection = strProjectionName;
            hSrcBB.CoordinateSystem.Datum = strDatum;
            hSrcBB.CoordinateSystem.Method = strProjection;
            hSrcBB.CoordinateSystem.Units = strUnits;
            hSrcBB.CoordinateSystem.LocalDatum = strLocalDatum;
            hSrcBB.MinX = dMinX;
            hSrcBB.MinY = dMinY;
            hSrcBB.MaxX = dMaxX;
            hSrcBB.MaxY = dMaxY;

            return true;
             }
             catch (Exception e)
             {
            GetDapError.Instance.Write("Reproject - " + e.Message);
             }
             finally
             {
            if (hPJ != null) hPJ.Dispose();
             }
             return false;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Reproject the src bounding box into the destination coordinate system
        /// </summary>
        /// <param name="hSrcBB"></param>
        /// <param name="hDestCS"></param>
        /// <returns></returns>
        internal static 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;
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Check to see if this is a valid bounding box
 /// </summary>
 /// <param name="dCoordinate"></param>
 /// <param name="dMin"></param>
 /// <param name="dMax"></param>
 /// <returns></returns>
 internal static bool IsValidBoundingBox(Geosoft.Dap.Common.BoundingBox oBox)
 {
     if (oBox.MinX < oBox.MaxX && oBox.MinY < oBox.MaxY)
     return true;
      return false;
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Reproject the src bounding box into the destination coordinate system
        /// </summary>
        /// <param name="hSrcBB"></param>
        /// <param name="hDestCS"></param>
        /// <returns></returns>
        internal static 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;
        }
Ejemplo n.º 8
0
 public DappleSearchWebDownload(Geosoft.Dap.Common.BoundingBox oBoundingBox, String strKeywords, int iPage, long lSearchIndex)
 {
     m_oBoundingBox = oBoundingBox;
     m_strKeywords = strKeywords;
     m_iPage = iPage;
     m_lSearchIndex = lSearchIndex;
 }
Ejemplo n.º 9
0
        public void SetSearchParameters(String strKeyword, Geosoft.Dap.Common.BoundingBox oBoundingBox)
        {
            m_lSearchIndex++;
            m_oSearchBoundingBox = oBoundingBox;
            m_strSearchString = strKeyword;

            if (String.Empty.Equals(strKeyword) && oBoundingBox == null)
            {
                SetNoSearch();
            }
            else
            {
                DappleSearchWebDownload oDownload = new DappleSearchWebDownload(m_oSearchBoundingBox, m_strSearchString, 0, m_lSearchIndex);
                SetSearching();
                oDownload.StartDownload(new DownloadCompleteHandler(SetSearchParametersComplete));
            }
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref= "T:DAPImageStore"/> class.
 /// </summary>
 internal DAPImageStore(DataSet oDataSet,
     Geosoft.GX.DAPGetData.Server server)
 {
     m_oDataSet = oDataSet;
      m_oServer = server;
 }