%function [bstruct,utmStruct] = bgeo2utm(bstruct)
function [bstruct,utmStruct] = bgeo2utm(bstruct)

geoid = selectGeoid;
utmStruct = [];
if isfield(bstruct,'latitude') & isfield(bstruct,'longitude') & ...
	~strcmp(bstruct.latitude,'*') & ~strcmp(bstruct.longitude,'*'),
	
	[easting,northing,utmStruct] = myutmcalc(bstruct.longitude, ...
		bstruct.latitude,'forward',geoid);
	
	bstruct = setfield(bstruct,'northing',northing);
	bstruct = setfield(bstruct,'easting',easting);
	bstruct = rmfield(bstruct,'latitude');
	bstruct = rmfield(bstruct,'longitude');

end

if isfield(bstruct,'initiallat') & isfield(bstruct,'initiallong') & ...
	~strcmp(bstruct.initiallat,'*') & ~strcmp(bstruct.initiallong,'*'),
	
	[easting,northing,utmStruct] = myutmcalc(bstruct.initiallong, ...
		bstruct.initiallat,'forward',geoid);
		
	bstruct = setfield(bstruct,'initialn',northing);
	bstruct = setfield(bstruct,'initiale',easting);
	bstruct = rmfield(bstruct,'initiallat');
	bstruct = rmfield(bstruct,'initiallong');
	
end
