当前位置: 首页>>代码示例>>C#>>正文


C# EnvelopeClass.Project方法代码示例

本文整理汇总了C#中EnvelopeClass.Project方法的典型用法代码示例。如果您正苦于以下问题:C# EnvelopeClass.Project方法的具体用法?C# EnvelopeClass.Project怎么用?C# EnvelopeClass.Project使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EnvelopeClass的用法示例。


在下文中一共展示了EnvelopeClass.Project方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: get_TipText

    /// <summary>
    /// Map tip text at the specified mouse location.
    /// </summary>
    /// <param name="X"></param>
    /// <param name="Y"></param>
    /// <param name="Tolerance"></param>
    /// <returns></returns>
    public override string get_TipText(double X, double Y, double Tolerance)
    {
      IEnvelope envelope = new EnvelopeClass();
      envelope.PutCoords(X - Tolerance, Y - Tolerance,X + Tolerance, Y + Tolerance);
      
      //reproject the envelope to the datasource doordinate system
			if (null != m_mapSpatialRef && m_mapSpatialRef.FactoryCode != m_layerSRFactoryCode)
      {
        envelope.SpatialReference = m_spatialRef;
        envelope.Project(m_mapSpatialRef);
      }

      double xmin, ymin, xmax, ymax;
      envelope.QueryCoords(out xmin, out ymin, out xmax, out ymax);  
      
      //select all the records within the given extent
      string qry = "LON >= " + xmin.ToString() + " AND LON <= " + xmax.ToString() + " AND Lat >= " + ymin.ToString() + " AND LAT <= " + ymax.ToString();
      DataRow[] rows = m_table.Select(qry);
      if(0 == rows.Length)
        return string.Empty;

      DataRow r = rows[0];
      string zipCode = Convert.ToString(r[1]);
      string cityName = Convert.ToString(r[2]);
      string temperature = Convert.ToString(r[5]);

      return cityName + ", " + zipCode + ", " + temperature + "F";
    }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:35,代码来源:RSSWeatherLayerClass.cs

示例2: SaveExtentAs

        /// <summary>
        /// Save the extent change into a new raster file.
        /// </summary>
        /// <param name="rasterLayer">Raster layer</param>
        /// <param name="fileName">Path of the output file</param>
        /// <param name="xmin">Minimum X coordinate</param>
        /// <param name="ymin">Minimum Y coordinate</param>                                                                          
        /// <param name="pixelSize">Pixel size</param>
        public static void SaveExtentAs(IRasterLayer rasterLayer, string fileName, double xmin, double ymin, double pixelSize)
        {
            IRasterProps rasterProps = (IRasterProps)rasterLayer.Raster;
            IEnvelope extent = new EnvelopeClass();
            extent.PutCoords(xmin, ymin, xmin + rasterProps.Width * pixelSize, ymin + rasterProps.Height * pixelSize);
            extent.Project(rasterProps.Extent.SpatialReference);
            rasterProps.Extent = extent;

            ISaveAs saveAs = (ISaveAs)rasterLayer.Raster;
            IWorkspaceFactory workspaceFactory = new RasterWorkspaceFactoryClass();
            IWorkspace mWorkspace = workspaceFactory.OpenFromFile(System.IO.Path.GetDirectoryName(fileName), 0);
            saveAs.SaveAs(System.IO.Path.GetFileName(fileName),
                          mWorkspace,
                          Raster.GetFormat(System.IO.Path.GetExtension(fileName)));
        }
开发者ID:nazzal88,项目名称:ares,代码行数:23,代码来源:Raster.cs

示例3: zoomButton_Click

        private void zoomButton_Click(object sender, System.EventArgs e)
        {
            try
            {
                Conflict conflict = getSelected();
                if(ext != null && conflict != null && conflict.Shape != null)
                {
                    IEnvelope env = new EnvelopeClass();
                    conflict.Shape.QueryEnvelope(env);

                    // need to reproject here!
                    if (this.ext.FocusMap.SpatialReference != null)
                    {
                        env.Project(this.ext.FocusMap.SpatialReference);
                        env.SnapToSpatialReference();
                    }

                    ((IActiveView)this.ext.FocusMap).Extent = env;
                    ((IActiveView)this.ext.FocusMap).Refresh();
                }
            }
            catch(Exception ee)
            {
                Logger.Warn(ee);
                MessageBox.Show("An Unexpected Error Occured: "+ee.Message+"\n\tPlease Review the Log.",
                    "EXCEPTION", MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
        }
开发者ID:EAWCS1,项目名称:SUITT,代码行数:29,代码来源:FormConflicts.cs

示例4: ConstructViewEnvAtPoint

        private IEnvelope ConstructViewEnvAtPoint(IPoint pt, double size)
        {
            IEnvelope theEnv = new EnvelopeClass();
            pt.Project(this.BCAlbersSpatialReference);
            theEnv.LowerLeft = pt;
            theEnv.Width = size;
            theEnv.Height = size;
            theEnv.Project(this.BCAlbersSpatialReference);
            theEnv.CenterAt(pt);

            return theEnv;
        }
开发者ID:EAWCS1,项目名称:SUITT,代码行数:12,代码来源:ErrorManagerCmd.cs


注:本文中的EnvelopeClass.Project方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。