ArcGIS中的线性参考/动态分段技术(三)几个Linear Referencing应用场景在AGS中的实现
现在来实现上面提到的3个功能。1、对于某条公路上的一点进行Identify操作,要求返回该点在公路上的桩号值: 以Silverlight API为例。为了在服务器端使用ArcObjects,在Asp.net工程中添加一个名为LinearRef的Silverlight-Enabled WCF Service,在LinearRef.svc.cs文件中添加以下代码:namespace RoadDycSeg.Web.WCF{ [ServiceContract(Namespace = “”)] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class LinearRef { public IRouteLocator2 pRtLocator = null; ESRI.ArcGIS.Server.IServerObjectManager pSOM = null; public ESRI.ArcGIS.Server.IServerContext pServerContext = null; public LinearRef() { ESRI.ArcGIS.ADF.Identity identity = new ESRI.ArcGIS.ADF.Identity(“ArcGISWebServices”, “yourpassword”, “”); ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection agsconn = new ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection(“localhost”, identity); agsconn.Connect(); pSOM = agsconn.ServerObjectManager; pServerContext = pSOM.CreateServerContext(“shaanxi”, “MapServer”); ESRI.ArcGIS.Carto.IMapServer2 pMapServer = pServerContext.ServerObject as ESRI.ArcGIS.Carto.IMapServer2; ESRI.ArcGIS.Carto.IMapServerObjects2 pMapServerObjects = pMapServer as ESRI.ArcGIS.Carto.IMapServerObjects2; … Continue reading ArcGIS中的线性参考/动态分段技术(三)几个Linear Referencing应用场景在AGS中的实现
