Map的度量单位

Posted by 蒋波涛 23 January,2007 Views (12)Comment
我们知道,GIS数据本身是不存储单位的,即一个Polyline或Polygon的长度或面积单位,是使用m还是英尺,并不是GIS数据所考虑的内容,它只保存几何属性和非几何属性的值。
地图在显示时出现的度量单位,一般是通过IMap::MapUnits来设置的,这是一个预先定义好的枚举值。
在图层被加载到Map对象中后,如果地图对象不存在一个坐标系统且图层的空间参考存在,则地图对象会使用该空间参考,此时,地图的MapUnits和DistanceUnits属性也被设置。
如果是多个图层被载入,则地图的空间参考是第一个图层的空间参考。
如果图层没有空间参考,那AddLayer方法会检查第一个图层的“AreaOfInterest”范围,如果它的值类似(XMin >= -180 and XMax <= 180 and YMin >= -90 and YMax <= 90)这样的地理坐标系统,则地图会认为数据将使用Mile英里作为长度单位。
如果这个值看起来不像地理坐标系,则Map会使用米作为单位。
MapUnits is the predefined enumeration (esriUnits) data type currently associated with the Map object.
AddLayer automatically attempts to set the Map's SpatialReference property if a coordinate system has not yet been defined for the map.  When the SpatialReference property is set, the Map's MapUnits and DistanceUnits properties are set as well.
When multiple layers are added simultaneously with AddLayers, the first spatial reference found is used.
If no layers have a spatial reference, AddLayer checks the extent of the first layer (ILayer::AreaOfInterest) and if it has coordinates that look like geographic coordinates (XMin >= -180 and XMax <= 180 and YMin >= -90 and YMax <= 90), ArcMap assumes the data is in decimal degrees and sets the MapUnits to esriDecimalDegrees and DistanceUnits to esriMiles.
If no spatial reference is found and the coordinates do not look like geographic coordinates, ArcMap sets no spatial reference and sets the MapUnits to esriMeters and the DistanceUnits to esriMeters.
由于这个单位值不能保存在数据中,如果需要保存这个状态的话,可以使用MXD文件来存储地图对象目前的状态。
好像我还没有说清楚,再讲一点。数据固然本身不含任何单位,但我们采集数据的时候,肯定是有度量单位而不是随心所欲的,我们在将数据载入Map对象的时候,必须将Map的度量单位设置为数据采集时的真实单位。如我们采集绘制数据时单位为米,在Map上做缓冲区分析之前,必须将DistanceUnits设置为米,你设置缓冲数值为10时,缓冲出来的宽度就是10米;如果你设置的单位是千米,那缓冲出来的宽度就是10KM。但无论采用何种设置,前后两次缓冲出来的多边形,相对于它周围的要素的空间位置,是没有任何改变的,决不会出现KM的时候更大一些。这是因为在相同坐标系下,相对距离总是一定的。

Related Items

Categories : ArcObjects Tags : ArcGIS  
Comments
2007-1-24 16:24:33

这里遇到一个问题,不知阁下能否帮忙。
我想实现一次缓冲区生成操作,希望能够根据输入的缓冲区大小来生成,那么我怎么才能控制输入数字的单位呢,即我没有办法确定该数字是什么单位。米、公里或者英寸似乎都可以

Posted by enable Gravatar Icon

2007-1-24 17:09:47

请看我修改后的blog,这个单位由Map的DistanceUnits来确定。

Posted by 蒋波涛 Gravatar Icon

2007-3-20 0:50:46

arcmap里的那个量距工具是可以根据单位的设置来调整数值的,请问它是怎么做的呢?

Posted by 433 Gravatar Icon

2007-3-21 23:10:53

设置Map Units 和Display Units

Posted by 蒋波涛 Gravatar Icon

2007-4-6 18:39:12

我在生成缓冲区前已经将map的DistanceUnits设置为esriUnits.Kilometers,为什么生成的缓冲区还是和esriUnits.DecimalDegree生成的缓冲区一样啊?

Posted by er Gravatar Icon

2007-7-27 16:25:24

上面的“请看我修改后的blog” --这个网址是什么呢?
还是请教类似上面的问题:
1.比如我设置捕捉的tolerance时,比如我给出0.5(Snap(0.5);),我想让它比如是metre单位,那么我在Snap(sometype tolerance)方法中怎样修改tolerance的类型(sometype )呢?
2.还有这个0.5(double)应该是pixels单位吧-屏幕单位?怎么转换成metre,能如MO中的ToMapDistance方法处理吗?怎么进行呢?
谢谢!

Posted by Holinz Gravatar Icon

2007-7-28 0:35:53

tolerance单位与显示单位一致,即DistanceUnits。
0.5不是屏幕单位,而是地图显示单位。

Posted by 蒋波涛 Gravatar Icon

2007-8-16 18:03:58

属性表里自动赋值的面积单位是DecimalDegree,怎么能换成平方米?

Posted by ycm Gravatar Icon

2007-8-18 16:40:47

数据库中是不携带单位的,单位是Map对象设置的,你可以选择Map属性,设置显示单位和距离单位均为Meter即可

Posted by 蒋波涛 Gravatar Icon

2008-5-5 11:49:52

你好, 怎么能实现arcgis地图的平滑移动. 如果平滑移动不行的, 能不能让标识不闪烁.谢谢

Posted by wings1972 Gravatar Icon

2008-9-6 19:33:20

属性表里自动赋值的面积单位是DecimalDegree,怎么能换成平方米?

2007-8-16 18:03:58
jbttm Says

数据库中是不携带单位的,单位是Map对象设置的,你可以选择Map属性,设置显示单位和距离单位均为Meter即可

这个设过,但是量算出来的折线长度,面积大小还是不是Meter,是否需要把参与计算的点的坐标系转换成Meter的坐标系?还是仅仅只是设置显示单位和距离单位就??谢谢

Posted by 距离面积计算 Gravatar Icon

2008-9-6 21:04:42

设置了Meter单位,意味着你使用的是米制的地理坐标系统,这个也是需要设置的。

Posted by 蒋波涛 Gravatar Icon

Leave a comment

Or, take a look at Archives and Categories

目录

存档