您的位置:首页 > 其它

ArcGIS地图文档MXD效率慢的一点建议(转)

2012-06-11 09:09 375 查看
来自:/article/1426541.html

最近关于ArcGIS的地图文档MXD慢的问题比较多,下面就对MXD的一点建议给大家分享!

关于地图文档MXD
地图文档其实是一个很好的对象,这个对象可以将我们配置好的地图包括(图层、符号、标注、比例尺、显示范围等)信息进行保存,然后我们使用MXD对上面的要求进行统一的管理,而且在我们发布地图服务时也需要使用该对象(虽然有MSD)。特别是在制图方面,地图文档的使用就更广泛了。

关于地图文档MXD的慢(以下都是数据源为ArcSDE为例)
一般用户反映我打开地图文档MXD比较慢,那么这个慢我们可以分两部分:
1:打开地图文档MXD的时候慢,也就是直接使用ArcMap双击MXD,那么在显示ArcMap的logo的时候,就非常慢
2:已经打开了ArcMap,但是加载相关图层,符号渲染等比较慢

再次强调一下,如果发现自己的ArcMap、ArcSDE、ArcGIS Server凡是使用到了地图文档慢的,请首先自觉的根据自己的相关版本将相关的补丁打全再往下看,因为这个很重要........

----------------------------------------------------------------------------------
对问题1的情况需要我们注意的:
1:服务器的防火墙是否关闭,或者5151端口是否禁用
2:服务器的IP是否修改
3:配置好的MXD的数据源是否改变
4:配置好的MXD的数据源的某些图层是否被删除
5:网络问题


典型问题:我在我本机配置好的MXD,怎么打开都很快,但是拷贝到其他机器就很慢?
解答:如果用户的ArcSDE连接为服务连接,应该不会出现该问题,但是仍然有用户反映,这个就根据用户的实际情况来做判断了。
如果用户的ArcSDE为直连,拷贝到其他用户打开肯定会有问题,因为直连需要netservicename,那么不同的机器可能配置的netservicename不一样,那么会有长时间打开,数据源为!号的现象,这也正常。

典型问题:我在我本机配置好的MXD,为什么我做了一些数据图层的删除,我的MXD打开就很慢?

解答:因为用户删除的是数据库内的图层,但是我们配置的MXD里面仍然保存了删除前图层的信息,那么加载图层会首先遍历MXD里面保存的信息,对找不到的图层可能会进行多次的查询等,所以会很慢。那么我们可以使用打开MXD后,将TOC里面的无效信息清空,然后save as copy一个新的MXD即可。

如果是连接其他服务器,加载的时候长时间未响应,可以直接将网线拔掉!这样会加快打开MXD的效率。

--------------------------------------------------------------------------------
对问题2的情况需要我们注意的:
1:配置好的MXD包含图层的多少
2:所有图层的数据量大小
3:所有图层的空间索引是否创建和有效使用
4:是否使用了高级制图方法(maplex标注、Representation)
5:是否有版本数据,进行版本压缩


因为如果你的这个MXD包含好多图层加载,而且使用了比较高级的渲染方法,都会导致在加载图层时候比较慢的情况,有些时候是正常的,可能根据你的服务器和客户端的配置情况才能优化了。

但是在我们加载多个图层的时候,ArcMap的左下角会有一个“Drawing...(某个要素类名称)”,那么我们根据这个来判断在MXD加载图层的过程中到底是哪个图层出现问题。

典型问题:在我在某个客户的一个现场问题,也是打开MXD的时候,针对用户的一个图块图层,加载就非常慢,这个图层大概有千万条记录,但是没有做任何符号的渲染,从这个情况可以看出肯定是这个图层的索引问题,或者没有使用空间索引,或者空间索引无效导致。
解决方法:重建空间索引,分析数据。

MXD Doctor
那么如果你的MXD有问题,就打不开怎么办?
ArcGIS提供了一个比较好的工具可以进行检查。MXD Doctor 是独立的应用程序,位于C:\Program Files (x86)\ArcGIS\Desktop10.0\Tools。该工具可用于分析已损坏的 .mxd 文件。根据分析结果,可将已损坏的 .mxd 文件中所包含的实体复制到新的或现有 .mxd 文件中。

MXD Doctor 主要用于从已损坏的 .mxd 文件中提取有效实体。但是,此工具也可以通过将一个 .mxd 文件中的内容复制到另一个 .mxd 文件的方式,对有效的 .mxd 文件中的实体进行检索。此工具还可用于从已损坏的 ArcScene (.sxd) 或 ArcGlobe (.3dd) 文档中提取 VBA 项目。只有将现有文档作为目标文档时,此功能才有效。启动 MXD Doctor 工具之前,需要先使用 ArcScene 或 ArcGlobe 来创建一个空白目标文档。要在 MXD Doctor 对话框中指定源文档和目标文档的文件名,可浏览至正确的文件夹并输入文档的文件名(因为浏览器支持 .mxd 和 .mxt 文件)。
相关参考:http://help.arcgis.com/zh-cn/arcgisdesktop/10.0/help/index.html#/na/000300000019000000/

文档碎片整理程序工具(DocDefragmenter)
ArcGIS 文档碎片整理程序工具位于C:\Program Files (x86)\ArcGIS\Desktop10.0\Tools,可对 .mxd 文件内存储的数据进行碎片整理,以尽可能减小文件大小。如果 .mxd 文件过大,此工具将十分有用。此工具也可以对 .sxd、.3dd 和 .mxt 文件进行碎片整理。

您可以对单个文档文件、特定文件夹中的所有 ArcGIS 文档或文件树中某点下的文件夹内的所有文档进行碎片整理。对于经过碎片整理的文档,有不同的放置选项可供选择。默认情况下,会在原始文件所在的文件夹中创建一个新文档文件,而新文件的名称与原始文件相同,只是在后加上了 _Defrag 后缀。例如,如果对 JoshuaTreeNP.mxd 进行碎片整理,则新文件名为 JoshuaTreeNP_Defrag.mxd。
相关参考:http://help.arcgis.com/zh-cn/arcgisdesktop/10.0/help/index.html#/na/000300000017000000/

ArcMAP MXD Redirect Data Sources
该工具只支持9.2/9.3,主要对用户的数据源破坏问题进行修复和替换。
相关参考:http://arcscripts.esri.com/details.asp?dbid=14456

mxdpefstat
MXDPERFSTAT (ArcGIS 10 和 93)可以帮助诊断典型的 MXD 文档的性能问题,例如

Inefficient scale dependency
Slow symbology
Large features
Projection on the fly
Potential database tuning

下载地址:http://arcscripts.esri.com/details.asp?dbid=16931

该工具是一个命令行工具,执行完毕之后,可以得到分析结果,可以看到每个图层的刷新时间,及图层显示时各阶段的时间,如果有问题,会在Recommendations里面给出建议,如下所示:

[html] view plaincopyprint?

C:\Users\Administrator\Downloads\AS16931\mxdpefstat>mxdperfstat10prerelease -mxd c:\1.mxd -scale 250000 -width 1920 -heght 1028
2012-3-14 9:54:40 Checking License
License: esriLicenseProductCodeArcInfo
2012-3-14 9:54:44 TestParams.SetParams check argsValid
2012-3-14 9:54:44 TestParams.SetParams ValidateMxd Start
2012-3-14 9:54:44 TestParams.SetParams ValidateMxd Finish
2012-3-14 9:54:44 new MainForm()
2012-3-14 9:54:44 InitializeComponent()
2012-3-14 9:54:45 InitializeComponent() Completed
2012-3-14 9:54:45 testParams.MxdDocumentPath
2012-3-14 9:54:45 mainForm.TestParams = testParams;
2012-3-14 9:54:45 Application.Run(mainForm)
2012-3-14 9:54:50(IMapControl3)axMapControl1.Object
2012-3-14 9:54:50axMapControl1.LoadMxFile(m_mapDocumentName)
2012-3-14 9:55:02 MainForm: RunTest(ref m_activeView)
Starting test
2012-3-14 9:55:03MainForm: RunTest() Started
GetVisibleLayers Scale=256972.111553785
Name=SDE.县级居民地point MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.县级居民地point
Name=SDE.地市级以上居民地4m MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.地市级以上居民地4m
Name=SDE.首都和省级行政中心4m MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.首都和省级行政中心4m
Name=SDE.地级行政界线polyline MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.地级行政界线polyline
Name=SDE.五级河流polyline MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.五级河流polyline
Name=SDE.主要铁路4m MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.主要铁路4m
Name=SDE.主要公路4m MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.主要公路4m
Name=SDE.国界与省界4l MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.国界与省界4l
Name=SDE.三级以上河流4l MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.三级以上河流4l
Name=SDE.国界4l MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.国界4l
Name=SDE.四级河流polyline MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.四级河流polyline
Name=SDE.一级河流4l MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.一级河流4l
Name=SDE.县级行政界线line MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.县级行政界线line
Name=SDE.国界与省界4p MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.国界与省界4p
Name=SDE.三级以上河流4p MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.三级以上河流4p
Name=SDE.国界4p MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.国界4p
Name=SDE.一级河流4p MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.一级河流4p
Name=SDE.县级行政界线poly MinimumScale=0, MaximumScale=0, Valid=True, Visible=True
ADDED Layer=SDE.县级行政界线poly
2012-3-14 9:55:04 Testing scale=250000
layer= 1 SDE.县级居民地point
2012-3-14 9:55:05Cursor features: layer=SDE.县级居民地point features=4
layer=SDE.县级居民地point Vertices=0 Features=0
LayerVertices=0
layer= 2 SDE.地市级以上居民地4m
2012-3-14 9:55:06Cursor features: layer=SDE.地市级以上居民地4m features=0
layer=SDE.地市级以上居民地4m Vertices=0 Features=0
LayerVertices=0
layer= 3 SDE.首都和省级行政中心4m
2012-3-14 9:55:06Cursor features: layer=SDE.首都和省级行政中心4m features=0
layer=SDE.首都和省级行政中心4m Vertices=0 Features=0
LayerVertices=0
layer= 4 SDE.地级行政界线polyline
2012-3-14 9:55:07Cursor features: layer=SDE.地级行政界线polyline features=0
layer=SDE.地级行政界线polyline Vertices=0 Features=0
LayerVertices=0
layer= 5 SDE.五级河流polyline
2012-3-14 9:55:08Cursor features: layer=SDE.五级河流polyline features=1
layer=SDE.五级河流polyline Vertices=109 Features=1
LayerVertices=109
layer= 6 SDE.主要铁路4m
2012-3-14 9:55:08Cursor features: layer=SDE.主要铁路4m features=0
layer=SDE.主要铁路4m Vertices=0 Features=0
LayerVertices=0
layer= 7 SDE.主要公路4m
2012-3-14 9:55:09Cursor features: layer=SDE.主要公路4m features=0
layer=SDE.主要公路4m Vertices=0 Features=0
LayerVertices=0
layer= 8 SDE.国界与省界4l
2012-3-14 9:55:10Cursor features: layer=SDE.国界与省界4l features=2
layer=SDE.国界与省界4l Vertices=374 Features=2
LayerVertices=374
layer= 9 SDE.三级以上河流4l
2012-3-14 9:55:11Cursor features: layer=SDE.三级以上河流4l features=3
layer=SDE.三级以上河流4l Vertices=67 Features=3
LayerVertices=67
layer= 10 SDE.国界4l
2012-3-14 9:55:11Cursor features: layer=SDE.国界4l features=0
layer=SDE.国界4l Vertices=0 Features=0
LayerVertices=0
layer= 11 SDE.四级河流polyline
2012-3-14 9:55:12Cursor features: layer=SDE.四级河流polyline features=1
layer=SDE.四级河流polyline Vertices=53 Features=1
LayerVertices=53
layer= 12 SDE.一级河流4l
2012-3-14 9:55:13Cursor features: layer=SDE.一级河流4l features=1
layer=SDE.一级河流4l Vertices=65 Features=1
LayerVertices=65
layer= 13 SDE.县级行政界线line
2012-3-14 9:55:14Cursor features: layer=SDE.县级行政界线line features=15
layer=SDE.县级行政界线line Vertices=724 Features=15
LayerVertices=724
layer= 14 SDE.国界与省界4p
2012-3-14 9:55:14Cursor features: layer=SDE.国界与省界4p features=2
layer=SDE.国界与省界4p Vertices=7046 Features=2
LayerVertices=7046
layer= 15 SDE.三级以上河流4p
2012-3-14 9:55:15Cursor features: layer=SDE.三级以上河流4p features=0
layer=SDE.三级以上河流4p Vertices=0 Features=0
LayerVertices=0
layer= 16 SDE.国界4p
2012-3-14 9:55:16Cursor features: layer=SDE.国界4p features=1
layer=SDE.国界4p Vertices=46220 Features=1
LayerVertices=46220
layer= 17 SDE.一级河流4p
2012-3-14 9:55:17Cursor features: layer=SDE.一级河流4p features=0
layer=SDE.一级河流4p Vertices=0 Features=0
LayerVertices=0
layer= 18 SDE.县级行政界线poly
2012-3-14 9:55:18Cursor features: layer=SDE.县级行政界线poly features=8
layer=SDE.县级行政界线poly Vertices=2848 Features=8
LayerVertices=2848
2012-3-14 9:55:19 RunTest:LoadXML
2012-3-14 9:55:19 RunTest: ESRI.ArcGIS.ADF.COMSupport.AOUninitialize.Shutdown()
2012-3-14 9:55:19 RunTest: ESRI.ArcGIS.ADF.COMSupport.AOUninitialize.Shutdown() Completed
2012-3-14 9:55:19 RunTest:Application.Exit()
2012-3-14 9:55:19 After RunTest:Application.Exit()
2012-3-14 9:55:19 Dspose: ESRI.ArcGIS.ADF.COMSupport.AOUninitialize.Shutdown()
2012-3-14 9:55:19 Dspose: ESRI.ArcGIS.ADF.COMSupport.AOUninitialize.Shutdown() Completed

我们在该目录下得到一个XML文件

MxdPerfStat

2012-3-14 9:55:19
c:\1.mxd
layerCount= 18
Unknown
esriDecimalDegrees
X= 104.25 Y= 28.48 width= 1920 height= 1028

Map Display Performance (sec) for each scale

ScaleRefresh Time(sec)VisibleLayers
256,972.4318
Layer Properties

ItemAt ScaleLayer NameRefresh Time (sec)RecommendationsFeaturesVerticesLabelingGeography Phase (sec)Graphics Phase (sec)Cursor Phase (sec)DBMS CPUDBMS LIODBMS PIOSourceLayerTypeLayer Spatial ReferenceLayerQueryDef
1256,972SDE.县级居民地point.02avoid projecting on the fly;4False.01.00.00.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPointGCS_WGS_1984
2256,972SDE.地市级以上居民地4m.03avoid projecting on the fly;False.01.00.00.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPointGCS_WGS_1984
3256,972SDE.首都和省级行政中心4m.02avoid projecting on the fly;False.01.00.00.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPointGCS_WGS_1984
4256,972SDE.地级行政界线polyline.02avoid projecting on the fly;False.01.00.00.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPolylineGCS_WGS_1984
5256,972SDE.五级河流polyline.02avoid projecting on the fly;1109False.01.00.00.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPolylineGCS_WGS_1984
6256,972SDE.主要铁路4m.02avoid projecting on the fly;False.01.00.00.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPolylineGCS_WGS_1984
7256,972SDE.主要公路4m.02avoid projecting on the fly;False.01.00.00.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPolylineGCS_WGS_1984
8256,972SDE.国界与省界4l.02avoid projecting on the fly;2374False.01.00.00.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPolylineGCS_WGS_1984
9256,972SDE.三级以上河流4l.02avoid projecting on the fly;367False.01.00.00.001esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPolylineGCS_WGS_1984
10256,972SDE.国界4l.02avoid projecting on the fly;False.01.00.00.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPolylineGCS_WGS_1984
11256,972SDE.四级河流polyline.02avoid projecting on the fly;153False.01.00.00.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPolylineGCS_WGS_1984
12256,972SDE.一级河流4l.03avoid projecting on the fly;165False.01.00.00.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPolylineGCS_WGS_1984
13256,972SDE.县级行政界线line.03avoid projecting on the fly;15724False.02.00.00.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPolylineGCS_WGS_1984
14256,972SDE.国界与省界4p.05avoid projecting on the fly;27,046False.03.01.02.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPolygonGCS_WGS_1984
15256,972SDE.三级以上河流4p.02avoid projecting on the fly;False.01.00.00.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPolygonGCS_WGS_1984
16256,972SDE.国界4p.26simplify geometry: vertices fetched=46220; avoid projecting on the fly;146,220False.25.00.12.001esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPolygonGCS_WGS_1984
17256,972SDE.一级河流4p.02avoid projecting on the fly;False.01.00.00.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPolygonGCS_WGS_1984
18256,972SDE.县级行政界线poly.03avoid projecting on the fly;82,848False.02.00.01.00esriDBMS_Oracle,192.168.220.165,5151,sdeesriGeometryPolygonGCS_WGS_1984

通过上面的信息,我们就可以对MXD做一个非常详细的性能评估,对我们制图,发布服务都是一个很好的参考!

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: