一段旋转图元几何体的代码

刚才突发奇想,顺手写了一段旋转日本的代码,惊奇的发现:如果逆时针旋转90度,由于投影造成的变形,日本就好像卧在雄鸡(祖国大陆)脖子下的一只虎视耽耽的野兽!卧榻之侧,岂容他人酣睡!,时刻保持警惕!
如果顺时针旋转90度,发现日本好像一个冲浪者,而前方就是宝岛台湾...
两幅图分别如下:



代码如下:
  Catalog cata  = MapInfo.Engine.Session.Current.Catalog;
  Table t = cata.GetTable("World");
  Feature f = cata.SearchForFeature(t, MapInfo.Data.SearchInfoFactory.SearchWhere("Country='Japan'"));
  DPoint dp = new DPoint(f.Geometry.GeometricCentroid.x, f.Geometry.GeometricCentroid.y);
  f.Geometry.GeometryEditor.Rotate(dp, 90);
  f.Geometry.EditingComplete();
  t.UpdateFeature(f);
  mapControl1.Map.SetView(f);

posted @ 2009-12-14 16:28  googlegis  阅读(153)  评论(0编辑  收藏  举报

坐标合肥,非典型GIS开发人员 GitHub