前往顾页
以后地位: 主页 > 收集编程 > 其他实例教程 >

操纵delphi说话写的mapinfo算法法度代码

时候:2011-04-08 09:42来源:知行网www.zhixing123.cn 编辑:麦田守望者

unit MapFunctionEx;

interface

uses
SysUtils, Windows, ADODB, Classes, Types, Contnrs, MapFunction, ComCtrls,
StrUtils, KD_MAPBASIC;

type
TKDPoint = class(TObject)
Public
X: double;
Y: double;
constructor Create(); Overload;
constructor Create(X: double; Y: double); Overload;
constructor Create(pt: TKDPoint); Overload;
function IsEqual(pt: TKDPoint): boolean; Overload;
function IsEqual(pt: TKDPoint; tolerace : double): boolean; Overload;
end;

TKDSegmentPoint = class(TObject)
Public
X: double;
Y: double;
SegmentInedex: integer;
constructor Create(); Overload;
constructor Create(pt: TKDPoint); Overload;
constructor Create(gpt: TKDSegmentPoint); Overload;
function Copy(): TKDSegmentPoint;
function ToPoint(): TKDPoint;
end;

type
TKDTrackTable = class(TObject)
Private
m_TrackTableName: string;
m_FilePath: string;
m_WinID: integer;
Public
constructor Create(WinID: integer);
property TrackTableName: string Read m_TrackTableName;
procedure CreateTrack(structTable: string);
procedure ClearTrack();
procedure DropTrack();
procedure PackTrack();
function TrackLine(): string;
function TrackPolygon(): string;
function TrackPoint(): string;
end;

type
/// 图形数据范例
TGrapiDataType = set of (gdtPoint, gdtPolygon, gdtLine, gdtText);

type
TKDMapinfoProxy = class(TObject)
Private
MapInfo: Variant;

procedure GetOrderIntersectNodes(tagetMapinfoGeo: string; mapinfoGeo: string; intersectNodes: TObjectList);
procedure QueryNodesOfGeomety(mapinfoGeo: string; partIndex: integer; nodeList: TObjectList); Overload;

Public
constructor Create(oleMapinfo: Variant);
procedure AddTable(tableName: string; mapId: integer);
function TableExists(tableName: string): boolean;
function CreateMap(tableName: string; mapName: string; hwnd: integer): integer;
procedure OpenTable(tablePath: string; tableAlias: string);
procedure CloneTableStructure(sourceTabla: string; destTablePath: string);
procedure SaveTableToFile(sourceTabla: string; destTablePath: string; whereClause: string);
procedure DropTable(tabName: string);
procedure DeleteTable(tableName: string);
function QueryTableRecordCount(tableName: string): integer;
function QueryTableColumnCount(tableName: string): integer;
function QueryTableColumnName(tableName: string; colIndex: integer): string;
function QueryTableColumnIndex(tableName: string; colName: string): integer;
function QueryTableColumnType(tableName: string; colName: string): integer;
procedure CloseTable(tableName: string);
procedure ClearTable(tableName: string);
procedure SaveAllTable();
function TableIsSaved(slName: string): boolean;
procedure PackTable(tabName: string);
procedure SplitLineTable(tableName: string; splitTableName: string);
procedure RepeatPoints(tagetTable: string; repeatTable: string);
procedure SplitLineTableEx(tableName: string; splitTableName: string);
procedure SplitLineByRegion(lineTableName: string; regionTableName: string);
function QueryNodeOfGeomety(mapinfoGeo: string; partIndex: integer; nodeIndex: integer): TKDPoint;
function QueryPartsOfGeomety(mapinfoGeo: string): integer;
function QueryNodesOfGeomety(mapinfoGeo: string; partIndex: integer): TObjectList; Overload;
function QueryNodeCount(mapinfoGeo: string; partIndex: integer): integer; Overload;
function QueryNodeCount(mapinfoGeo: string): integer; Overload;
procedure QueryNodePoint(mapinfoGeo: string; Polygon_num, node_num: integer; var X, Y: double);
function ObjectCvtPolygon(bm1, bm2: string): string;
procedure ObjectCvtPolygonEx(sourceTable, destTable: string);
function ObjectCvtLine(bm1, bm2: string; ProBar: TProgressBar = nil): string;
function GetObjType(objName: string): integer;
function CheckTableObject(TableType: TGrapiDataType; bm: string): integer;
procedure SaveTable(tableName: string);
procedure CommitTable(tableName: string);
procedure RollbackTable(tableName: string);
procedure CopyTableData(srcTableName: string; destTableName: string; whereClause: string);
procedure CopyTableDataEx(srcTableName: string; destTableName: string; whereClause: string; fieldList: string);
procedure CopyTableGhraphData(srcTableName: string; destTableName: string; whereClause: string);
procedure EraseObjects(srcTableName: string; eraseTableName: string);
function EmnuTableColumn(tableName: string; withName: boolean = true): string;
function QuerySourceTableName(selectionName: string): string;
function QuerySelctionCount(): integer;
function QuerySelctionTableName(): string;
procedure UnitePolygon(strYTableName: string; strMBTableName: string; CurWinID: integer);
procedure SetProgressBar(bOn: boolean = true);
procedure SetTableEnable(tableName: string; bUserBrowse: boolean = true; bUserMap: boolean = true; bUserClose: boolean = true; bUserRemove: boolean = true; bUserDisplayMap: boolean = true);
procedure LineSplitPolygon(strLineTableName: string; strPolygonTableName: string);
procedure EarsureObj(strYTableName: string; strMBTableName: string; bBosom: boolean = true);
function CheckRepeatPolygon(checkedTable, errorViewTable : string; toleranceArea: double; units: string) : boolean;
function CheckPolygonState(strTableName: string; var rowId : string ): boolean;
procedure AutoSnap(tableName: string; tolerance: double; units: string; whereClause: string);
procedure SimplePLine(tableName: string; distance: double; units: string; whereClause: string);
procedure SimplePLine_2(tableName: string; bend: double; distance: double; units: string; whereClause: string);
procedure RemoveRegion(tableName: string; area: double; units: string; whereClause: string);
function GetIntersectNodes(tagetMapinfoGeo: string; mapinfoGeo: string): TObjectList;
function GetBevelRate(pt1: TKDPoint; pt2: TKDPoint; precision: integer): double;
function BetweenOnPointsX(targetPt: TKDPoint; fromPt: TKDPoint; toPt: TKDPoint): boolean;
function BetweenOnPointsY(targetPt: TKDPoint; fromPt: TKDPoint; toPt: TKDPoint): boolean;
function BetweenOnPoints(targetPt: TKDPoint; fromPt: TKDPoint; toPt: TKDPoint): boolean;
procedure ConvertPolyongToSimplePline(polyTable, polyUidField, plineTable, plineUidFiled: string);
//从头排序图层
procedure ReOrderAllLayer(CurWinID: integer; OrderNumString: string);
procedure LayerToLayerIndex(CurWinID: integer; LayerIndex, ToLayerIndex: integer);
function GetLayerCount(WinID: integer): integer;
function GetLayerIndex(WinID: integer; strTabName: string): integer;
function GetLayerName(WinID: integer; strTabIndex: integer): string;
function CheckTableObjec(X, Y: double; strTableName: string; radius: double; flag: integer): boolean;
//分化图层中的工具
procedure Disaggregate(strTableName: string; bAll: boolean);
procedure UnitePiecePolygon(strTableName: string; intArea: double = 100);
procedure UonionObject(tableName: string; whereClause: string);
procedure LineSplitPolyong_2(lineTable: string; polyTable: string);
procedure LineAntitone(strTableName: string; RowID: integer);
procedure ShowArrows(LayerName: string; bShow: boolean = true);
function GetSelectionLayerName(): string;
//将图形转换为折线工具
procedure CvtToPLine(mapinfoGeo: string);
procedure CvtToRegion(mapinfoGeo: string);
//面层豆割面层
procedure SplitByPolygon(tableName: string; splitTableName: string);
procedure CvtToPLineTable(strTableName: string; strTableName2: string; CurWinID: integer); Overload;

------分开线----------------------------
标签(Tag):delphi说话
------分开线----------------------------
保举内容
猜你感兴趣