在RGEOS项目中,投影变换是通过Proj.Net来实现的。

支持的投影主要包括AlbersProjection、TransverseMercator、Mercator、Krovak、Lambert Conformal Conic 2SP,自己扩展了一个GaussKruger投影。

以下实现了一个WGS84椭球的UTM投影(TransverseMercator)

 ICoordinateSystem utm = ProjNet.CoordinateSystems.ProjectedCoordinateSystem.WGS84_UTM(zone, pGeo.Y > );

查看代码:

 public static ProjectedCoordinateSystem WGS84_UTM(int Zone, bool ZoneIsNorth)
{
List<ProjectionParameter> pInfo = new List<ProjectionParameter>();
pInfo.Add(new ProjectionParameter("latitude_of_origin", ));
pInfo.Add(new ProjectionParameter("central_meridian", Zone * - ));
pInfo.Add(new ProjectionParameter("scale_factor", 0.9996));
pInfo.Add(new ProjectionParameter("false_easting", ));
pInfo.Add(new ProjectionParameter("false_northing", ZoneIsNorth ? : ));
//IProjection projection = cFac.CreateProjection("UTM" + Zone.ToString() + (ZoneIsNorth ? "N" : "S"), "Transverse_Mercator", parameters);
Projection proj = new Projection("Transverse_Mercator", pInfo, "UTM" + Zone.ToString(System.Globalization.CultureInfo.InvariantCulture) + (ZoneIsNorth ? "N" : "S"),
"EPSG", + Zone + (ZoneIsNorth ? : ), String.Empty, String.Empty, String.Empty);
System.Collections.Generic.List<AxisInfo> axes = new List<AxisInfo>();
axes.Add(new AxisInfo("East", AxisOrientationEnum.East));
axes.Add(new AxisInfo("North", AxisOrientationEnum.North));
return new ProjectedCoordinateSystem(ProjNet.CoordinateSystems.HorizontalDatum.WGS84,
ProjNet.CoordinateSystems.GeographicCoordinateSystem.WGS84, ProjNet.CoordinateSystems.LinearUnit.Metre, proj, axes,
"WGS 84 / UTM zone " + Zone.ToString(System.Globalization.CultureInfo.InvariantCulture) + (ZoneIsNorth ? "N" : "S"), "EPSG", + Zone + (ZoneIsNorth ? : ),
String.Empty, "Large and medium scale topographic mapping and engineering survey.", string.Empty);
}

WGS84_UTM

自己尝试写一个工厂没有写完全:

 using System;
using System.Collections.Generic;
using System.Text; namespace ProjNet.CoordinateSystems
{
public class SpatialReferenceEnvironmentClass : ISpatialReferenceFactory
{
public IEllipsoid CreateSpheroid(int spheroidType)
{
IEllipsoid ellipsoid = null;
switch (spheroidType)
{
case (int)RgSRSpheroidType.RgSRSpheroid_WGS1984:
ellipsoid = new Ellipsoid(, , 298.257223563, true, LinearUnit.Metre, "WGS 84", "EPSG", , "WGS 84", "", "Inverse flattening derived from four defining parameters (semi-major axis; C20 = -484.16685*10e-6; earth's angular velocity w = 7292115e11 rad/sec; gravitational constant GM = 3986005e8 m*m*m/s/s).");
break;
case (int)RgSRSpheroidType.RgSRSpheroid_Krasovsky1940:
ellipsoid = new Ellipsoid(, , 298.30000000000001, true, LinearUnit.Metre, "Krasovsky_1940", "EPSG", , "Krasovsky_1940", "", "");
break;
case (int)RgSRSpheroid2Type.RgSRSpheroid_Xian1980:
ellipsoid = new Ellipsoid(, , 298.25700000000001, true, LinearUnit.Metre, "Xian_1980", "EPSG", , "Xian_1980", "", "");
break;
}
return ellipsoid;
} public IHorizontalDatum CreateDatum(int datumType)
{
IHorizontalDatum datum = null;
switch (datumType)
{
case (int)RgSRDatumType.RgSRDatum_WGS1984:
IEllipsoid ellipsoid = this.CreateSpheroid((int)RgSRSpheroidType.RgSRSpheroid_WGS1984);
datum = new HorizontalDatum(ellipsoid, null, DatumType.HD_Geocentric, "World Geodetic System 1984", "EPSG", , String.Empty, "EPSG's WGS 84 datum has been the then current realisation. No distinction is made between the original WGS 84 frame, WGS 84 (G730), WGS 84 (G873) and WGS 84 (G1150). Since 1997, WGS 84 has been maintained within 10cm of the then current ITRF.", String.Empty);
break;
case (int)RgSRDatumType.RgSRDatum_Beijing1954:
IEllipsoid ellipsoid2 = this.CreateSpheroid((int)RgSRSpheroidType.RgSRSpheroid_Krasovsky1940);
datum = new HorizontalDatum(ellipsoid2, null, DatumType.HD_Geocentric, "D_Beijing1954", "EPSG", , String.Empty, "", String.Empty);
break;
case (int)RgSRDatumType.RgSRDatum_Xian1980:
IEllipsoid ellipsoid3 = this.CreateSpheroid((int)RgSRSpheroid2Type.RgSRSpheroid_Xian1980);
datum = new HorizontalDatum(ellipsoid3, null, DatumType.HD_Geocentric, "D_Xian1980", "EPSG", , String.Empty, "", String.Empty);
break;
}
return datum;
} public IGeographicCoordinateSystem CreateGeographicCoordinateSystem(int gcsType)
{
IGeographicCoordinateSystem gcs = null;
switch (gcsType)
{ case (int)RgSRGeoCSType.RgSRGeoCS_WGS1984:// WGS 1984.
List<AxisInfo> axes = new List<AxisInfo>();
axes.Add(new AxisInfo("Lon", AxisOrientationEnum.East));
axes.Add(new AxisInfo("Lat", AxisOrientationEnum.North));
IHorizontalDatum datum = this.CreateDatum((int)RgSRDatumType.RgSRDatum_WGS1984);
gcs = new GeographicCoordinateSystem(CoordinateSystems.AngularUnit.Degrees,
datum, CoordinateSystems.PrimeMeridian.Greenwich, axes,
"WGS1984", "EPSG", , String.Empty, string.Empty, string.Empty);
break;
case (int)RgSRGeoCSType.RgSRGeoCS_Beijing1954:
List<AxisInfo> axes2 = new List<AxisInfo>();
axes2.Add(new AxisInfo("Lon", AxisOrientationEnum.East));
axes2.Add(new AxisInfo("Lat", AxisOrientationEnum.North));
IHorizontalDatum datum2 = this.CreateDatum((int)RgSRDatumType.RgSRDatum_Beijing1954);
gcs = new GeographicCoordinateSystem(CoordinateSystems.AngularUnit.Degrees,
datum2, CoordinateSystems.PrimeMeridian.Greenwich, axes2,
"Beijing1954", "EPSG", , String.Empty, string.Empty, string.Empty);
break;
case (int)RgSRGeoCS3Type.RgSRGeoCS_Xian1980://Xian80.
List<AxisInfo> axes3 = new List<AxisInfo>();
axes3.Add(new AxisInfo("Lon", AxisOrientationEnum.East));
axes3.Add(new AxisInfo("Lat", AxisOrientationEnum.North));
IHorizontalDatum datum3 = this.CreateDatum((int)RgSRDatumType.RgSRDatum_Xian1980);
gcs = new GeographicCoordinateSystem(CoordinateSystems.AngularUnit.Degrees,
datum3, CoordinateSystems.PrimeMeridian.Greenwich, axes3,
"Xian1980", "EPSG", , String.Empty, string.Empty, string.Empty);
break; }
return gcs;
} public IProjectedCoordinateSystem CreateProjectedCoordinateSystem(int pcsType)
{
throw new NotImplementedException();
}
public IProjection CreateProjection(int projectionType)
{
switch (projectionType)
{
case (int)RgSRProjectionType.RgSRProjection_Albers:
break;
case (int)RgSRProjectionType.RgSRProjection_GaussKruger:
break;
case (int)RgSRProjectionType.RgSRProjection_Mercator:
break;
case (int)RgSRProjectionType.RgSRProjection_TransverseMercator:
break;
case (int)RgSRProjectionType.RgSRProjection_LambertConformalConic:
break;
}
return null;
}
}
}

SpatialReferenceEnvironmentClass

使用Proj.Net创建空间参考的更多相关文章

  1. ArcEngine 创建空间参考设置默认域

    ISpatialReferenceFactory3 spatialReferenceFactory = new SpatialReferenceEnvironmentClass(); outSR = ...

  2. ArcGIS Engine开发之旅09--几何对象和空间参考

    原文:ArcGIS Engine开发之旅09--几何对象和空间参考 1.Geometry  Geometry 是 GIS 中使用最为广泛的对象集之一,用户在创建.删除.编辑和进行地理分析的时候,就是处 ...

  3. 空间参考系统与WKT解析

    空间参考系统与WKT解析 1.为什么要空间参考系统? 空间参考系统,也称为坐标系统.在GIS中为地理数据定位的基准,假设给你一个坐标(442281.875,4422651.589).如果不给你空间参考 ...

  4. ArcGIS for qml -关于空间参考如何选择设置

    作者: 狐狸家的鱼 Github: 八至 版权声明:如需转载请获取授权和联系作者 1.关于空间参考 空间参考可以通过众所周知的ID(WKID) - 整数值来引用. 官网指南中也有对此的专门说明 htt ...

  5. ArcGIS空间参考概述

    摘要:在地理数据库中,坐标系和其他相关空间属性被定义为各数据集的空间参考的一部分.空间参考是用于存储各要素类和栅格数据集,以及其他坐标属性(例如,x,y 坐标的坐标分辨率及可选的 z 坐标和测量 (m ...

  6. GIS空间参考及坐标转换

    空间参考(Spatial Reference)是 GIS 数据的骨骼框架,能够将我们的数据定位到相应的位置,为地图中的每一点提供准确的坐标. 在同一个地图上显示的地图数据的空间参考必须是一致的,如果两 ...

  7. ArcGIS api for javascript——设置自定义范围和空间参考

    描述 这个示例展示了在创建地图时如果定义一个自定义的范围和空间参考. 在 ArcGIS JavaScript API的1.0和1.1版本,任何要使用的地图服务图层都需要和地图的空间参考一致.1.2版本 ...

  8. ARCGIS切图:TPK文件的空间参考为地理坐标系

    先来吐槽一下,之前习惯了百度地图API,所以一直习惯直接将经纬度点添加到地图上进行显示,目前使用ARCGIS RUNTIME FOR ANDROID进行开发,在地图上加点需要原始点的坐标为投影坐标系, ...

  9. Openlayer3之空间参考扩展

    Openlayers默认了两种空间参考,一个是EPSG4326,一个是EPSG3857,其它的空间参考需要进行扩展才能使用.所以我们初始化时进行了如下操作: 1.将配置数据库中所有的空间参考读取出来, ...

随机推荐

  1. LiveUpdate Adminstrator配置手册

    第一种模式: LUA 从Symantec官网LiveUpdate服务器下载更新. .登陆LUA控制台 图1 .添加Symantec Endpoint Protecton v11.0 图2 3. 查看源 ...

  2. Codeforces Round #375 (Div. 2)——D. Lakes in Berland(DFS连通块)

    D. Lakes in Berland time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  3. 前端编码规范(4)—— CSS 和 Sass (SCSS) 规范

    CSS and Sass (SCSS) style rules ID and class naming ID和class(类)名总是使用可以反应元素目的和用途的名称,或其他通用名称.代替表象和晦涩难懂 ...

  4. java数组排序问题:array.sort()是从小到大排序,那么如何从大到小排序?

    别告诉我从i=a.length开始打印然后i--!因为数组没变啊,只是打印顺序变了.有木有啥别的方法,除了冒泡插入选择.. nteger [] array=new Integer[]{1,2,3,4, ...

  5. P1149 火柴棒等式

    #include <bits/stdc++.h> using namespace std; const int num[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6} ...

  6. MillWheel: Fault-Tolerant Stream Processing at Internet Scale

    http://static.googleusercontent.com/media/research.google.com/zh-CN//pubs/archive/41378.pdf   为什么要做M ...

  7. linux下常用的命令

    一.  tomcat  tail -f ../logs/catalina.out                        最新更新的日志(tomcat) cat ../logs/catalina ...

  8. js文档视口高度函数

    objwin=window;objBody=document.body;objDel=document.documentElement;   关于弹窗时候用到 function getPageHeig ...

  9. ubuntu 制作deb 包

    ubuntu下打包制作deb安装包 http://www.th7.cn/system/lin/201406/61012.shtml   2014-06-22 20:16:45CSDN-yangbing ...

  10. android导入项目出现R文件不能生成

    关于原因网上有好多,比如 1.有时候eclipse不自动编译,把project clean一下,让R.java重新生成   2.选择菜单  Project >> Clean ,前提是勾选上 ...