arcgis arcengine Using environment settings
In this topic
About using environment settings
| Method | Description |
| GetEnvironmentValue(envName) | Retrieves the value of an environment by name. |
| SetEnvironmentValue(envName, envValue) | Updates the value of an environment by name. |
| ResetEnvironments() | Resets the environments to their default state. |
| ListEnvironments("*") | Returns the list of environments (properties). |
| SaveSettings(sFileName) | Saves the current settings (toolboxes, environments, and so on) to a file on disk in Extensible Markup Language (XML) format. |
| LoadSettings(sFileName) | Loads the current settings from the saved file. |
[C#]
public void setCoordinateSystem(IGeoProcessor2 gp)
{
// Set overwrite option to true.
gp.OverwriteOutput = true; // Set workspace environment.
gp.SetEnvironmentValue("workspace", @"C:\data\saltlake.gdb"); // Set the output coordinate system environment.
gp.SetEnvironmentValue("outputCoordinateSystem", @
"C:\Program Files\ArcGIS\Desktop10.0\Coordinate Systems\Projected Coordinate Systems\UTM\Nad 1983\NAD 1983 UTM Zone 12N.prj"); IVariantArray parameters = new VarArrayClass();
parameters.Add("roads");
parameters.Add("roads_copy"); gp.Execute("CopyFeatures_management", parameters, null);
}
[VB.NET]
Public Sub setCoordinateSystem(ByVal gp As IGeoProcessor2)
'Set overwrite option to true.
gp.OverwriteOutput = True
'Set workspace environment.
gp.SetEnvironmentValue("workspace", "C:\data\saltlake.gdb")
'Set the output coordinate system environment.
gp.SetEnvironmentValue("outputCoordinateSystem", "C:\Program Files\ArcGIS\Desktop10.0\Coordinate Systems\Projected Coordinate Systems\UTM\Nad 1983\NAD 1983 UTM Zone 12N.prj")
Dim parameters As IVariantArray = New VarArray
parameters.Add("roads")
parameters.Add("roads_copy")
gp.Execute("CopyFeatures_management", parameters, Nothing)
End Sub
[C#]
// Get the cell size environment value.
object env = gp.GetEnvironmentValue("cellsize"); // Reset the environment values to their defaults.
gp.ResetEnvironments();
[VB.NET]
' Get the cell size environment value.
Dim env As Object = GP.GetEnvironmentValue("cellsize") ' Reset the environment values to their defaults.
GP.ResetEnvironments()
[C#]
public void ListGeoprocessingEnvironments(IGeoprocessor2 gp)
{
// List all environments that start with the letter q.
IGpEnumList environments = gp.ListEnvironments("q*"); // Only one environment starts with q (qualifiedFieldNames).
string env = environments.Next();
Console.WriteLine(env); }
[VB.NET]
Public Sub ListGeoprocessingEnvironments(ByVal gp As IGeoProcessor2)
'List all environments that start with the letter q.
Dim environments As IGpEnumList = gp.ListEnvironments("q*")
Dim env As String = environments.Next()
'Only one environment starts with q (qualifiedFieldNames).
Console.WriteLine(env)
env = environments.Next()
End Sub
[C#]
public void SaveLoadSettings(IGeoProcessor2 gp)
{
gp.SetEnvironmentValue("workspace", @"C:/data/mydata.gdb");
gp.SetEnvironmentValue("extent", "-3532000, -911000, -3515000, -890000");
gp.SetEnvironmentValue("outputCoordinateSystem",
"PROJCS['NAD_1983_UTM_Zone_11N',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-117.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]"); // Save environment settings to an XML file.
string settingsFile = @"C:\sdk\MyCustomSettings.xml";
gp.SaveSettings(settingsFile); // Load previously saved environment settings.
gp.LoadSettings(settingsFile);
object sExtent = gp.GetEnvironmentValue("workspace");
}
[VB.NET]
Public Sub SaveLoadSettings(ByVal gp As IGeoProcessor2)
gp.SetEnvironmentValue("workspace", "C:/data/mydata.gdb")
gp.SetEnvironmentValue("extent", "-3532000, -911000, -3515000, -890000")
gp.SetEnvironmentValue("outputCoordinateSystem", "PROJCS['NAD_1983_UTM_Zone_11N',GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['False_Easting',500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-117.0],PARAMETER['Scale_Factor',0.9996],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]")
' Save environment settings to an XML file.
Dim settingsFile As String = "C:\sdk\MyCustomSettings.xml"
gp.SaveSettings(settingsFile)
' Load previously saved environment settings.
gp.LoadSettings(settingsFile)
Dim sExtent As Object = gp.GetEnvironmentValue("workspace")
End Sub
Environment settings summary table
|
Environment name
|
Display name
|
|
autoCommit
|
|
|
cartographicCoordinateSystem
|
|
|
cellSize
|
|
|
coincidentPoints
|
|
|
compression
|
|
|
configKeyword
|
|
|
derivedPrecision
|
|
|
extent
|
|
|
geographicTransformations
|
|
|
maintainSpatialIndex
|
|
|
mask
|
|
|
MDomain
|
|
|
MResolution
|
|
|
MTolerance
|
|
|
newPrecision
|
|
|
outputCoordinateSystem
|
|
|
outputMFlag
|
|
|
outputZFlag
|
|
|
outputZValue
|
|
|
projectCompare
|
|
|
pyramid
|
|
|
qualifiedFieldNames
|
|
|
randomGenerator
|
|
|
rasterStatistics
|
|
|
referenceScale
|
|
|
scratchWorkspace
|
|
|
snapRaster
|
|
|
spatialGrid1, 2, 3
|
|
|
terrainMemoryUsage
|
|
|
tileSize
|
|
|
tinSaveVersion
|
|
|
workspace
|
|
|
XYDomain
|
|
|
XYResolution
|
|
|
XYTolerance
|
|
|
ZDomain
|
|
|
ZResolution
|
|
|
ZTolerance
|
See Also:
What is a geoprocessing environment?
A quick tour of geoprocessing environments
arcgis arcengine Using environment settings的更多相关文章
- Arcgis, ArcEngine, Arcgis Server使用开发汇总 索引
ArcGIS系列软件license及安装: Arcgis SDE10.1 和 Arcgis server10.1的授权文件license tnt_esri.dat Arcgis8.1安装license ...
- c# 调用ArcEngine的GP工具
转自原文c# 调用ArcEngine的GP工具,AE调用GP工具 IAoInitialize m_AoInitialize = new AoInitializeClass(); esriLicense ...
- ArcGIS教程:加权叠加
摘要 使用经常使用測量比例叠加多个栅格数据,并依据各栅格数据的重要性分配权重. 插图 插图中,两个输入栅格已又一次分类为 1 至 3 三种公共測量级别.为每一个栅格均分配了一个影响百分比.这些像元值与 ...
- ArcGIS教程:创建特征
摘要 创建由输入样本数据和一组栅格波段定义的类的 ASCII 特征文件. 使用方法 · 输出特征文件应使用扩展名 .gsg. · 输入栅格波段和输入栅格或要素样本数据必须具有重叠范围.将仅为公共区域计 ...
- AE(ArcEngine)定制工具Tool工具箱
using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServi ...
- How to work with the snap environment
How to work with the snap environment SummaryThe snap environment manages snap agents and snap toler ...
- arcgis mpk 打包地图 (数据管理)
摘要 来自:http://help.arcgis.com/zh-cn/arcgisdesktop/10.0/help/index.html#/na/0017000000q5000000/ 对地图文档以 ...
- ArcGIS教程:编辑特征
摘要 通过合并.又一次编号和删除类特征来编辑和更新特征文件. 使用方法 · 编辑特征工具同意您通过下面全部操作或某一操作来改动现有特征文件: 合并一组特征类 又一次编号特征类 ID 删除不须要的特征 ...
- arcgis影像批量裁剪代码
# -*- coding:utf-8 -*- # Name: ExtractByMask_Ex_02.py # Description: Extracts the cells of a raster ...
随机推荐
- 【Win 10 应用开发】Toast通知激活应用——前台&后台
老周最近热衷于讲故事,接下来还是讲故事时间. 有人问我:你上大学的时候,有加入过学生会吗?读大学有没有必要加入学生会? 哎哟,这怎么回答呢,从短期来说,加入学生会有点用,至少可以娱乐一下,运气好的话, ...
- 【转】C#语言之“string格式的日期时间字符串转为DateTime类型”的方法
方法一:Convert.ToDateTime(string) string格式有要求,必须是yyyy-MM-dd hh:mm:ss ================================== ...
- ASP.NET MVC5 网站开发实践(二) Member区域–我的咨询列表及添加咨询
上次把咨询的架构搭好了,现在分两次来完成咨询:1.用户部分,2管理部分.这次实现用户部分,包含两个功能,查看我的咨询和进行咨询. 目录: ASP.NET MVC5 网站开发实践 - 概述 ASP.NE ...
- android app反编译
最新在反编译别人的apk,有时候看到别人的app有很炫的效果,就想知道别人是怎么样实现的,顺便自己参考,借鉴一下,下一次如果工作中碰到这个问题就知道怎么实现了.最近恰好放假三天,就研究了一下,一般别人 ...
- (转)使用minicpan创建本地CPAN
在临时的办公场所网络不畅,有时不能下载cpan上的软件包,所有只能自建一个cpan. 这里使用了工具'minicpan',简单地说:就是把互联网上的CPAN搬到自己的电脑里,它的最初想法来自Randa ...
- geotrellis使用(二十)geotrellis1.0版本新功能及变化介绍
目录 前言 变化情况介绍 总结 一.前言 之前版本是0.9或者0.10.1.0.10.2,最近发现更新成为1.0.0-2077839.1.0应该也能称之为正式版了吧.发现其中有很多变化, ...
- 开发中常用js记录(二)
(1)获得asp.net控件的value值 document.getElementById('<%=SUKid.ClientID %>').value (2)获得选中值 $('#selec ...
- Sybase数据库,普通表修改分区表步骤
本文目标:指导项目侧人员再遇到此类改动需求时可以自己参照更改.需求:Sybase数据库,普通表t_jingyu修改为按天分区的分区表. 1.sp_help查看t_jingyu的表结构,索引等信息 sp ...
- 你的程序支持复杂的时间调度嘛?如约而来的 java 版本
你的程序支持复杂的时间调度嘛? 这篇文章介绍了时间适配器的c#版本,是给客户端用的,服务器自然也要有一套对应的做法,java版本的 [年][月][日][星期][时间] [*][*][*][*][*] ...
- linux源码分析(三)-start_kernel
前置:这里使用的linux版本是4.8,x86体系. start_kernel是过了引导阶段,进入到了内核启动阶段的入口.函数在init/main.c中. set_task_stack_end_mag ...