It may take a time to convert plot one by one between global and local coordinates and back, especially in inventory projects with multiple number of inventory plots. The functions ConvertCoordinatesFromGlobalToLocal and ConvertCoordinatesFromLocalToGlobal allowes to convert multiple number of plots in batch.
The following example expect the name of your root layer “Plots” and defined the coordinate system with the name “WGS 1984 UTM Zone 33N” (definition in Georeferencing, hot key F9).
This function is available since Field-Map version X8.0.10171
vlst := InputFromCheckListTab( ‘Plots for co-ordinate conversion’,’Select plots’,
tb,
‘%s (%s) [%s]’,
‘ID;Name;CoordSysName’,
‘ID’,’ID’);
if vlst<>nil then
try
OpenLog(‘Convert co-ordinates from global to local ‘);
StartProgressBarCycle(vlst.Count+1);
for P := 0 to vlst.Count-1 do begin
StepProgressBar;
Project.OpenPlotUsingDataCollector(vlst.Value[P]);
Log(format(‘Processing plot %d (%s)’,[Plots.ValueAsInteger[‘ID’],Plots.ValueAsString[‘Name’]]));
if Project.ConvertCoordinatesFromGlobalToLocal(ErrorMessage_)<>0 then
Log(#9+ErrorMessage_);
end;
ResetProgressBar;
Log(”);
Log(‘Conversion successfully finished.’);
finally
vlst.Free;
end;
finally
tb.Free;
end;
end.
vlst := InputFromCheckListTab( ‘Plots for co-ordinate conversion’,’Select plots’,
tb,
‘%s (%s) [%s]’,
‘ID;Name;CoordSysName’,
‘ID’,’ID’);
if vlst<>nil then
try
OpenLog(‘Convert co-ordinates from local to global’);
StartProgressBarCycle(vlst.Count+1);
for P := 0 to vlst.Count-1 do begin
StepProgressBar;
Project.OpenPlotUsingDataCollector(vlst.Value[P]);
Log(format(‘Processing plot %d (%s)’,[Plots.ValueAsInteger[‘ID’],Plots.ValueAsString[‘Name’]]));
Project.MapProjection:=’WGS 1984 UTM Zone 33N’; //name of the coordinate system prepared in Georeferencing
if Project.ConvertCoordinatesFromLocalToGlobal(true,ErrorMessage_)<>0 then
Log(#9+ErrorMessage_);
end;
ResetProgressBar;
Log(”);
Log(‘Conversion successfully finished.’);
finally
vlst.Free;
end;
finally
tb.Free;
end;
end.