ArcGIS Server代码动态创建发布服务(MapServer,ImageServer)
来源:互联网 发布:男士网红淘宝店铺 编辑:程序博客网 时间:2024/05/17 23:29
- #region 创建地图服务
- private bool CreateServices(string MapPath, string ServerName)//ServerName为地图服务设置的服务名
- {
- ESRI.ArcGIS.ADF.Identity identity = new ESRI.ArcGIS.ADF.Identity(MapServerUserName, MapserverPass, "");//MapServerUserName和MapserverPass为连接ArcGIS Server的用户名和密码
- ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection agsConnection = new ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection(HostName, identity);//HostName为ArcGIS Server所在服务器的主机名
- agsConnection.Connect();
- IServerObjectAdmin pServerObjectAdmin;
- pServerObjectAdmin = agsConnection.ServerObjectAdmin;
- IServerObjectConfiguration2 configuration = (IServerObjectConfiguration2)pServerObjectAdmin.CreateConfiguration();
- configuration.Name = ServerName;//发布Service的名称,必填
- configuration.TypeName = "MapServer";//发布服务的类型,如:MapServer,GeocodeServer
- IPropertySet props = configuration.Properties;
- props.SetProperty("FilePath", MapPath);//设置MXD的路径
- props.SetProperty("OutputDir", "c:\\arcgisserver\\arcgisoutput");//图片的输出目录
- props.SetProperty("VirtualOutPutDir", "http://" + HostName + "/arcgisoutput");//图片输出的虚拟路径
- props.SetProperty("SupportedImageReturnTypes", "URL");//支持的图片类型
- props.SetProperty("MaxImageHeight", "2048");//图片的最大高度
- props.SetProperty("MaxRecordCount", "500");//返回记录的最大条数
- props.SetProperty("MaxBufferCount", "100");//缓冲区分析的最大数目
- props.SetProperty("MaxImageWidth", "2048");//图片的最大宽度
- props.SetProperty("IsCached", "false");//是否切片
- props.SetProperty("CacheOnDemand", "false");//是否主动切片
- props.SetProperty("IgnoreCache", "false");//是否忽略切片
- props.SetProperty("ClientCachingAllowed", "true");//是否允许客户端缓冲
- props.SetProperty("CacheDir", "c:\\arcgisserver\\arcgiscache\\NewService");//切片的输出路径
- props.SetProperty("SOMCacheDir", "c:\\arcgisserver\\arcgiscache");//som的切片输出路径
- //configuration.Description = "NewService";//Service的描述
- configuration.IsolationLevel = esriServerIsolationLevel.esriServerIsolationHigh;//或者esriServerIsolationLow,esriServerIsolationAny
- configuration.IsPooled = true;//是否池化
- configuration.MaxInstances = 2;//最多的实例数
- configuration.MinInstances = 1;//最少的实例数
- ////设置刷新
- IPropertySet recycleProp = configuration.RecycleProperties;
- recycleProp.SetProperty("StartTime", "00:00");//刷新开始时间
- recycleProp.SetProperty("Interval", "3600");//刷新间隔
- ////设置是否开启REST服务
- IPropertySet infoProp = configuration.Info;
- infoProp.SetProperty("WebEnabled", "true");//是否提供REST服务
- infoProp.SetProperty("WebCapabilities", "Map,Query,Data");//提供何种服务
- //configuration.StartupType = esriStartupType.esriSTAutomatic;//或者esriSTManual
- //configuration.UsageTimeout = 120;//客户端占用一个服务的最长时间
- //configuration.WaitTimeout = 120;//客户端申请一个服务的最长等待时间
- #endregion
- //添加服务到Server
- pServerObjectAdmin.AddConfiguration(configuration);
- //启动服务
- pServerObjectAdmin.StartConfiguration(ServerName, "MapServer");//设置服务类型为MapServer,并启动服务
- return true;
- }
- #endregion
- private bool CreateServices(string ImagePath, string ServerName)
- {
- ESRI.ArcGIS.ADF.Identity identity = new ESRI.ArcGIS.ADF.Identity(MapServerUserName, MapserverPass, "");
- ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection agsConnection = new
- ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection(HostName, identity);
- agsConnection.Connect();
- IServerObjectAdmin pServerObjectAdmin;
- pServerObjectAdmin = agsConnection.ServerObjectAdmin;
- IServerObjectConfiguration2 configuration = (IServerObjectConfiguration2)pServerObjectAdmin.CreateConfiguration();
- configuration.Name = ServerName;//发布Service的名称,必填
- configuration.TypeName = "ImageServer";//发布服务的类型,如:MapServer,GeocodeServer
- IPropertySet propertySet = configuration.Properties;
- <span style="color:#ff0000;"> propertySet.SetProperty("Path", ImagePath);//设置Image的路径</span>
- propertySet.SetProperty("Start", "00:00");
- propertySet.SetProperty("Interval", "24");
- propertySet.SetProperty("SupportedImageReturnTypes", "URL");
- <span style="color:#ff9900;"> propertySet.SetProperty("OutputDir", "c:\\arcgisserver\\arcgisoutput");//图片的输出目录
- propertySet.SetProperty("VirtualOutPutDir", "http://" + HostName + "/arcgisoutput");//图片输出的虚拟路径</span>
- //propertySet.SetProperty("MaxImageHeight", 4100);//4100
- // propertySet.SetProperty("MaxImageWidth", 15000);//15000
- //propertySet.SetProperty("AllowedCompressions", "None,JPEG,LZ77");//"None,JPEG,LZ77"
- //propertySet.SetProperty("DefaultResamplingMethod", 0);//0
- //propertySet.SetProperty("DefaultCompressionQuality", 75);//75
- //propertySet.SetProperty("MaxRecordCount", 500);//500
- //propertySet.SetProperty("MaxMosaicImageCount", 1);//20
- //propertySet.SetProperty("MaxDownloadImageCount", 20);//20
- //propertySet.SetProperty("AllowedFields","Name,MinPS,MaxPS,LowPS,HighPS,CenterX,CenterY");//"Name,MinPS,MaxPS,LowPS,HighPS,CenterX,CenterY"
- //propertySet.SetProperty("AllowedMosaicMethods","Center,NorthWest,LockRaster,ByAttribute,Nadir,Viewpoint,Seamline");//"Center,NorthWest,LockRaster,ByAttribute,Nadir,Viewpoint,Seamline"
- //propertySet.SetProperty("AllowedItemMetadata", "Full");//"Full"
- //ImageServiceInfo pImageSerivce = new ImageServiceInfo();
- configuration.StartupType = esriStartupType.esriSTAutomatic;
- configuration.MinInstances = 1;
- configuration.MaxInstances = 2;
- configuration.IsPooled = true;
- configuration.Info.SetProperty("WebEnabled", "true");
- configuration.Info.SetProperty("WebCapabilities", "Image,Catalog,Metadata,Download,Pixels");
- pServerObjectAdmin.AddConfiguration(configuration);
- //启动服务
- pServerObjectAdmin.StartConfiguration(ServerName, "ImageServer");//设置服务类型并启动服务
- return true;
- }
- ArcGIS Server代码动态创建发布服务(MapServer,ImageServer)
- ArcGIS Server代码动态创建发布服务(MapServer,ImageServer)
- ArcGIS Server动态创建MapServer
- 关于ArcEngine自动创建Arcgis Server的Mapserver服务
- (一)ArcGIS Server之发布动态地图服务
- ArcGIS API For Flex对ImageServer发布的服务进行渲染及RasterFunction支持函数(学习笔记)
- ArcGIS API For Flex对ImageServer发布的服务进行渲染及RasterFunction支持函数(学习笔记)
- 发布ArcGIS MapServer
- arcgis server 动态创建地图服务
- arcgis server 动态创建地图服务
- arcgis server服务发布
- ArcGIS Server 发布 REST 服务
- ArcGIS Server 发布地图服务
- Arcgis Server发布GP服务
- ArcGIS Server 发布 REST 服务
- Arcgis Server发布GP服务
- ArcGIS Server发布地图服务
- ArcGIS创建发布地图服务
- 如何在Android模拟器上添加和删除应用
- 32位Ubuntu 11.10下android2.3.7源码下载与编译小结
- 每个程序员都应该知道的一些时间数据
- 一个基于SVN 的代码提交量统计工具
- coffee-script
- ArcGIS Server代码动态创建发布服务(MapServer,ImageServer)
- devenv命令说明
- java.lang.IllegalStateException: No FacesContext is available to process this request的另一种处理方法
- 一个新东西:GDBTUI
- rpc启动
- 【QTP】把外部VBS写入resource中
- Java网络编程总结(转)
- SQL函数和XSL函数在XML Publisher中的使用
- 应用程序部署总结