【问题标题】:Geoprocessing service - empty memory after calling地理处理服务 - 调用后清空内存
【发布时间】:2011-10-11 23:42:48
【问题描述】:

我正在关注 ADF 库的此示例

http://edndoc.esri.com/arcobjects/9.2/NET_Server_Doc/developer/samples/Web_Applications/ArcGIS_Buffer_Geoprocessing/ee05ac98-384b-4dbe-b8e3-8d741180dc9a.htm

我实际上是在使用地理处理服务围绕一个点画一个圆圈。半径约20公里。

代码运行良好,但“清除”例程却不行。每次我从以前的数据中清除地图时,缓冲服务的内存也没有被清除,我得到了这个

“清除”例程的代码与示例相同,但不起作用:

// Clears features from all graphics layers in the resource specified by _graphicsResourceName
protected void ClearGraphics()
{
    // Retrieve the resource and clear its graphics dataset
    ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource graphicsMapResource =
        Map1.GetFunctionality(_graphicsResourceName).Resource as
        ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource;
    graphicsMapResource.Graphics.Clear();

// This won't work too
GeoprocessingResourceManager1.GetResource(0).ClearState();

// Refresh the resource and copy the map's callback results to the callback results collection so
// the graphics are removed from the map
Map1.RefreshResource(graphicsMapResource.Name);
_callbackResultCollection.CopyFrom(Map1.CallbackResults);
}

这应该很简单,但我不知道如何解决这个问题。我找到的唯一解决方案是重新启动 IIS 服务器,这显然很糟糕

有人可以帮帮我吗?

【问题讨论】:

  • 你能显示用于绘制圆圈的代码吗? (大致)
  • 这里是代码:nopaste.info/0c123fa03e.html 寻找 /////////////////////////// /////// 注释部分以粗略解释发生了什么
  • 对不起,我不够清楚,我的意思是向集合中添加圆圈的代码。您正在使用renderer.GetAllSymbols 方法获取项目列表。必须有一个地方可以创建这些符号并将其添加到集合中?我没有使用过这个 API,但那是我要寻找的地方。
  • 我认为这里添加了点: // 将每个点添加到我们用作 GP 任务输入的要素图形层 foreach (System.Data.DataRow dataRow in pointElementGraphicsLayer.Rows) { ESRI.ArcGIS.ADF.Web.Geometry.Point adfPoint = pointElementGraphicsLayer.GeometryFromRow(dataRow) as ESRI.ArcGIS.ADF.Web.Geometry.Point; featureGraphicsLayer.Add(adfPoint); }

标签: c# asp.net arcgis esri arcgis-server


【解决方案1】:

通过清除作业队列解决

【讨论】:

    【解决方案2】:

    我通常使用GraphicsLayerFunctionality.GraphicsDataSet.Tables.Clear();

    ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource myMapResource myMapResource.Graphics.Tables.Remove(图形元素);

    您实际上是在处理一个 .NET 数据集

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-23
      • 1970-01-01
      • 2012-08-03
      • 1970-01-01
      • 1970-01-01
      • 2018-12-16
      相关资源
      最近更新 更多