Flyingis]ArcEngine中的Spatial Refrence (3)
来源:互联网 发布:windows 10 activation 编辑:程序博客网 时间:2024/06/03 17:28
除了ISpatialReferenceFactory接口,AE还提供ISpatialReferenceFactory3接口实现了创建垂直坐标系、构建高精度坐标系和低精度坐标系的系列方法。 private void ConstructCoordinateSystem(bool highPrecision) 我们可以创建一个新的投影坐标系并保存为prj文件,同时可以利用这个prj生成一个新的投影坐标系。 private void ImportExportSR_Example()
{
ISpatialReferenceFactory3 spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
ISpatialReference3 spatialReference = spatialReferenceFactory.CreateESRISpatialReferenceFromPRJFile("D://ArcGIS//Coordinate Systems//Geographic Coordinate Systems//World//WGS 1984.prj") as ISpatialReference3;
IControlPrecision2 controlPrecision = spatialReference as IControlPrecision2;
//Determines whether you are constructing a high or low.
controlPrecision.IsHighPrecision = highPrecision;
ISpatialReferenceResolution spatialReferenceResolution = spatialReference as ISpatialReferenceResolution;
//These three methods are the keys, construct horizon, then set the default x,y resolution and tolerance.
spatialReferenceResolution.ConstructFromHorizon();
//Set the default x,y resolution value.
spatialReferenceResolution.SetDefaultXYResolution();
//Set the default x,y tolerance value.
ISpatialReferenceTolerance spatialReferenceTolerance = spatialReference as ISpatialReferenceTolerance;
spatialReferenceTolerance.SetDefaultXYTolerance();
double xMin;
double xMax;
double yMin;
double yMax;
spatialReference.GetDomain(out xMin, out xMax, out yMin, out yMax);
System.Windows.Forms.MessageBox.Show("Domain : " + xMin + ", " + xMax + ", " + yMin + ", " + yMax);
}
IControlPrecision2.IsHighPrecision用来判断是否对数据采用高精度坐标,后面的设置空间参考的方法将根据这个判断来决定各种参数的精确程度。highPrecision等于true或false时,返回的Domain分别是:
highPrecision=true -400 9006799.25474099 -400 9006799.25474099
highPrecision=false -400 793.04646944444426 -400 793.04646944444426
可以看出两者之间精度差别的大小。
{
//Instantiate a predefined spatial reference and set its coordinate grid information.
ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
IProjectedCoordinateSystem projectedCoordinateSystem = spatialReferenceFactory.CreateProjectedCoordinateSystem((int)esriSRProjCSType.esriSRProjCS_WGS1984UTM_10N);
ISpatialReferenceResolution spatialReferenceResolution = projectedCoordinateSystem as ISpatialReferenceResolution;
ISpatialReferenceTolerance spatialReferenceTolerance = projectedCoordinateSystem as ISpatialReferenceTolerance;
spatialReferenceResolution.ConstructFromHorizon();
spatialReferenceTolerance.SetDefaultXYTolerance();
//Export the PCS to a .prj file.
String fileName = "c://temp//utm10.prj";
spatialReferenceFactory.ExportESRISpatialReferenceToPRJFile(fileName, projectedCoordinateSystem);
//Rehydrate it as a new spatial reference object.
ISpatialReference projectedCoordinateSystem2 = spatialReferenceFactory.CreateESRISpatialReferenceFromPRJFile(fileName);
//See if they are equal.
IClone comparison = projectedCoordinateSystem as IClone;
//Should be true, but coordinate grid information has not been checked.
System.Windows.Forms.MessageBox.Show((comparison.IsEqual(projectedCoordinateSystem2 as IClone)).ToString());
ISpatialReference2 comparePrecisions = projectedCoordinateSystem as ISpatialReference2;
//Should be false, PRJ files do not persist coordinate grid information.
System.Windows.Forms.MessageBox.Show((comparePrecisions.IsXYPrecisionEqual(projectedCoordinateSystem2)).ToString());
}
- Flyingis]ArcEngine中的Spatial Refrence (3)
- ArcEngine 中的数据统计 DataStatistics
- ArcEngine 中的数据统计 DataStatistics
- arcengine中的几何镜像
- ArcEngine中的ICommand和ITool
- ArcEngine中的ICommand和ITool
- ArcEngine开发中的空间关系
- IDW Spatial Analyst(ESRI.ArcGIS.SpatialAnalystTools)ArcEngine中反距离加权插值方法
- Oracle Spatial中的空间图层
- ArcGIS教程:Spatial Analyst 中的运算类型
- ArcSDE vs. Oracle Spatial 3
- Arcgis:Spatial & 3D Analysis
- ArcEngine调用GeoServer中的WMS地图服务
- 利用ArcEngine操作Arcgis中的样式库。
- arcengine 实现调用arctoolbox中的dissolove
- ArcEngine 获取HDF文件中的子文件
- c#+ArcEngine中的IGroupLayer的用法
- ArcEngine中的几种地图刷新模式
- Ubuntu系统里安装JDK1.6
- Great Html Tab Panel Using CSS and Javascript
- 计算机安全超级工具(七)——无线渗透
- 注意办公室的言行礼仪
- 2008、9年高校毕业就业分析
- Flyingis]ArcEngine中的Spatial Refrence (3)
- Flex组件自动获取输入焦点
- 扣费克星-您的话费守护神 v1.42 新增联网程序管理扩展插件发布
- DB2事务日志使用经验
- 比较好的英文技术网站
- VARARGS,STDARGS,可变参数列表摘要
- PM-项目管理(Project Management)
- SecureCRT
- asterisk学习笔记2