用Data source-specific APIs 编程

本文详细介绍了ArcGIS Server API的两种主要交互方式:SOAP和ArcObjects。涵盖了MapResource类型的使用方法,包括互联网连接和服务端直接访问的方式,并探讨了通过不同编程手段进行地图资源操作的具体实现。

ArcGIS Server APIs
SOAP
1)XML-structured 语言。
2)
server objectsserver object extensions可用。
3)
设计用作stateless 交互。
4)Catalog
请求由IServerCatalogAdmin 接口处理。
5)Service
请求由IRequestHandler 接口处理。
ArcObjects
1)
远程与GIS Server上的ArcObjects 交互。
2)
使用客户端的Primary Interop Assemblies (PIA) object libraries
3)
通过SOM访问获得ArcGIS Server services
4)
设计用作stateless stateful 交互。

ArcGIS Server MapResource 类型

AMapResourceInternet – 连接到Web service endpoint

BMapResourceLocal – 连接到Server Object Manager

1)访问ServerContext

2)使用ArcObjects

 

ArcGIS Server Internet: SOAP编程

1)MapResourceInternet

MapServerProxy, 访问value objects

2)通讯是stateless

3)使用pooled objects

Dim mapRes as ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceInternet

mapRes = gisFunc.Resource

Dim mapsProxy as ArcGISServer.MapServerProxy = mapRes.MapServerProxy

Dim mapInfo as ArcGISServer.MapServerInfo =

mapsProxy.GetServerInfo(mapsProxy.GetDefaultMapName())

Dim mapDesc as ArcGISServer.MapDescription = mapInfo.DefaultMapDescription

Dim mLayerInfo as ArcGIServer.MapLayerInfo()

mLayerInfo = mapRes.MapServerInfo.MapLayerInfos

Dim layerDescs as ArcGISServer.LayerDescription()

layerDescs = mapDesc.LayerDescriptions

 

ArcGIS Server Local: ArcObjects 编程

1)远程访问ArcObjects

2)MapServerLocal

MapServer > IMapServer (COM) >IMapServerObjects (COM)

3)通过.NET部件访问高级的functionality

 

Dim mapFunc as IMapFunctionality = Map1.GetFunctionality(0)

Dim ags_mr as ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal

ags_mr =

CType(mapFunc.Resource,ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal)

' Access the ArcObjects COM ServerObject directly

Dim mapServer as ESRI.ArcGIS.Carto. IMapServer = CType(ags_mr.MapServer,IMapServer)

Dim mapServerObjs as ESRI.ArcGIS.Carto.IMapServerObjects

mapServerObjs = CType(mapServer,IMapServerObjects)

Dim map as ESRI.ArcGIS.Carto.IMap = mapServerObjs.Map

' Now perform more ArcObjects operations

Dim featClass as IFeatureClass = CType(map.Layers(0)).FeatureClass,

 

 

深入ArcGIS Server Local API

1)MapResourceLocal

通过DCOM访问server上的ArcObjects

ServerContext

2)所有的过程在远程完成

 

 

 

ArcObjects 远程编程

1)能在服务器上创建新的对象

2)MapServerLocal

ServerContextInfo

ServerContext

3)不需要release servercontext

Dim ags_mr as ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal

ags_mr =

CType(qfunc.Resource,ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal)

' Create a new ArcObjects COM objects

Dim context as ESRI.ArcGIS.Server.IServerContext = ags_mr.ServerContextInfo.ServerContext

Dim pnt as ESRI.ArcGIS.Geometry.IPoint = context.CreateObject("esriGeometry.Point")

pnt.X = 60

pnt.Y = 100

Dim topo as ESRI.ArcGIS.Geometry.ITopologicalOperator = CType(pnt, Itopological)

 

常用开发模式

--首先建立连接

Identity identity = new Identity("username", "pwd", "domain");
AGSServerConnection connection = new AGSServerConnection("fmc-pca187", identity);
connection.Connect();

--获得服务器对象

IServerObjectManager m_pSOM = connection. ServerObjectManager ;
IServerContext m_pServerContext = m_pSOM. CreateServerContext (" testMap" , "MapServer" ) ;
IMapServer pMapServer = m_pServerContext . ServerObject  as IMapServer ;

--使用服务器对象

IMapServerObject s pMapServerObject s = ( IMapServerObject s) pMapServer ;
IMap pMap = pMapServerObject s. get_Map (pMapServer .DefaultMapName) ;
IFeatureLayer p FLayer = ( IFeatureLayer) pMap. get_Layer(0) ;
IFeatureClass p FeatureClass = p FLayer . FeatureClass ;
int i = p FeatureClass. FeatureCount (null) ; 

--释放服务器对象

m_pServerContext . ReleaseContext () ;

  

 

 

06-07
### SOURCE in Programming or Data Context In the context of programming and data, the term **SOURCE** can refer to multiple concepts depending on the specific domain being discussed. Below is a detailed explanation of what **SOURCE** might represent in various technical contexts: #### 1. Source Code The most common usage of the term **SOURCE** in programming refers to **source code**, which is the human-readable version of a program written in a programming language such as Ruby[^3]. This source code is later compiled or interpreted into machine-executable code. #### 2. Data Source In the context of data, **SOURCE** often refers to the origin or provider of data. For example: - In file I/O operations, the source could be a file from which data is read[^2]. - In database systems, the source might refer to tables, views, or external APIs that supply data. - In web development, the source could be an API endpoint or a database query result. #### 3. Input Source When discussing input/output (I/O) operations, the term **SOURCE** may describe where the input originates. For instance, in serial I/O, the source of data might be a device connected via a serial port, which typically involves slower transmission speeds compared to file I/O[^2]. #### 4. Context Programming In certain paradigms like **controller and context programming**, the concept of **SOURCE** might relate to the selection of elements within a user interface. For example, when choosing a context element in a table line, the source could be the marked line itself, even though related elements are not automatically selected[^4]. #### 5. Object-Oriented Perspective From an object-oriented standpoint, particularly in languages like Ruby[^3], **SOURCE** could also imply the origin of method calls or data flow between objects. For instance, if one object invokes a method on another, the invoking object acts as the source of the interaction. ```python # Example demonstrating source in object-oriented programming class DataSource: def __init__(self, data): self.data = data def get_data(self): return self.data # The source of this data is the 'data' attribute source = DataSource("Sample Data") print(source.get_data()) # Output: Sample Data ``` ### Summary The term **SOURCE** in programming or data contexts can denote several entities, including source code, data origins, input devices, or even interactions in object-oriented systems. Its precise meaning depends heavily on the specific scenario being addressed.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值