我正在使用 mitab.dll 读取 MapInfo 文件(*.tab + 朋友)。这些文件可能包含简单的折线和曲线。到目前为止,我一直无法区分这两者并将所有内容都视为折线。是否有任何 mitab-API 调用可以让我确定我正在阅读这两种线型中的哪一种?
(简化)代码:
procedure HandlePolyline(_Feature: mitab_Feature);
var
i, j: LongInt;
pointCount: LongInt;
partCount: LongInt;
X, Y: array of Double;
begin
partCount := FMitabDll.get_parts(_Feature);
for i := 0 to partCount - 1 do begin
pointCount := FMitabDll.get_vertex_count(_Feature, i);
SetLength(X, pointCount);
SetLength(Y, pointCount);
for j := 0 to pointCount - 1 do begin
X[j] := FMitabDll.get_vertex_x(_Feature, i, j);
Y[j] := FMitabDll.get_vertex_y(_Feature, i, j);
end;
// -> Here I have got a polyline, but it might be a curved line, how do I know?
end;
end;
i := 1;
repeat
feature := FMitabDll.read_feature(FTabHandle, i);
FeatureType := FMitabDll.get_type(feature);
case FeatureType of
TABFC_Polyline: HandlePolyline(feature);
end;
i := FMitabDll.next_feature_id(FTabHandle, i);
FMitabDll.destroy_feature(feature);
until i = -1;
(这是使用 Delphi 2077,但我采用任何其他使用 mitab 的解决方案。)