1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| Function AddNearestPolygFromRoad(Pnt : MapWinGis_Tlb.Point; Position : Integer;
Dx, Dy : Double; InList : TList; RefSf : ShapeFile): TList;
Var
Ext : Extents;
X, Y, IncX, IncY, Incr : Extended;
i, j, NoPolyg : Integer;
Polyg : MapWinGis_Tlb.Shape;
PolygList : OleVariant;
TmpPolygList : Array of Integer;
PolygExist, Condition : Boolean;
begin
Incr := 1;
if Dx = 0 then IncX := Incr else IncX := 0;
if Dy = 0 then IncY := Incr else IncY := 0;
X := Pnt.x; Y := Pnt.Y;
PolygExist := False;
Ext := RefSf.Extents as Extents;
Condition := False;
While Not Condition do // construction de l'extents minimum comportant
begin // un polygone
Dx := Dx + IncX; // incrémentation des dimensions de l'extent
Dy := Dy + IncY;
Ext.SetBounds(X - Dx, y - Dy, 0, X + Dx, y + Dy, 0);
PolygExist := RefSf.SelectShapes(Ext, 0, Intersection, PolygList);
if Not PolygExist then Continue;
TmpPolygList := PolygList;
For i := 0 to Length(TmpPolygList) -1 do
begin
Polyg := CoShape.Create;
Polyg := RefSf.Shape[TmpPolygList[i]];
For j := 1 to Polyg.numPoints - 1 do
begin
...
...
end;
end;
end; |
Partager