mapxtreme 更改图元的位置
//用来改变某一个图元的位置 ,使用offestxy函数
Catalog cat = MapInfo.Engine.Session.Current.Catalog;
Table tbl = cat.GetTable("地铁站");
if (tbl != null)
{
//更新点的位置
tbl.BeginAccess(MapInfo.Data.TableAccessMode.Write);
foreach (Feature fcar in tbl)
{
fcar.Geometry.GetGeometryEditor().OffsetByXY(0.5, 0, MapInfo.Geometry.DistanceUnit.Degree, MapInfo.Geometry.DistanceType.Spherical);
fcar.Geometry.EditingComplete();
fcar.Update();
}
tbl.EndAccess();
}
Catalog cat = MapInfo.Engine.Session.Current.Catalog;
Table tbl = cat.GetTable("地铁站");
if (tbl != null)
{
//更新点的位置
tbl.BeginAccess(MapInfo.Data.TableAccessMode.Write);
foreach (Feature fcar in tbl)
{
fcar.Geometry.GetGeometryEditor().OffsetByXY(0.5, 0, MapInfo.Geometry.DistanceUnit.Degree, MapInfo.Geometry.DistanceType.Spherical);
fcar.Geometry.EditingComplete();
fcar.Update();
}
tbl.EndAccess();
}

浙公网安备 33010602011771号