Topic: MAP AREA
Hello MVD!
Please help me on how to compute 2 or more areas within one map.. Also if possible together to the routes...
Right now, I can only show computation on per polygon and per polyline....
Thanks
My Visual Database → General → MAP AREA
Hello MVD!
Please help me on how to compute 2 or more areas within one map.. Also if possible together to the routes...
Right now, I can only show computation on per polygon and per polyline....
Thanks
Hello.
For polygons
procedure frmRegion_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
ShowMessage( GetPolygonsAreaSqMeters(frmRegion.MapRegion) );
end;
function GetPolygonsAreaSqMeters (Map: TdbMap): double;
var
i: integer;
s: string;
d: double;
begin
d := 0;
for i := 0 to Map.Polygons.Count-1 do
begin
s := Map.GetPolygonAreaSqMeters(i);
if not ValidFloat(s) then s := ReplaceStr(s, '.', ',');
if ValidFloat(s) then d := d + StrToFloat(s);
end;
result := d;
end;
for polylines
procedure frmRoute_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
km: double;
begin
km := GetPolylinesLengthKMeters(frmRoute.MapRoute);
ShowMessage(FloatToStr(km) + ' km');
end;
function GetPolylinesLengthKMeters (Map: TdbMap): double;
var
i, iPath: integer;
d: double;
begin
d := 0;
for i := 0 to Map.Polylines.Count-1 do
begin
for iPath := 1 to Map.Polylines[i].Polyline.Path.Count-1 do
begin
d := d + Map.Distance( Map.Polylines[i].Polyline.Path[iPath].Latitude, Map.Polylines[i].Polyline.Path[iPath].Longitude, Map.Polylines[i].Polyline.Path[iPath-1].Latitude, Map.Polylines[i].Polyline.Path[iPath-1].Longitude);
end;
end;
result := d;
end;
THANKS SO MUCH DRIVESOFT!
My Visual Database → General → MAP AREA
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi