www.sdlsuite.com Forum Index www.sdlsuite.com
Discussion of technical aspects of the SDL Component Suite
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AddCalibpoint problem in XE2 version

 
Post new topic   Reply to topic    www.sdlsuite.com Forum Index -> GeoPack
View previous topic :: View next topic  
Author Message
jvgoor



Joined: 07 Sep 2011
Posts: 42
Location: Maasland, The Netherlands

PostPosted: Wed Oct 19, 2011 9:39 pm    Post subject: AddCalibpoint problem in XE2 version Reply with quote

Hans,

I have downloaded and installed the new XE2 version of Geopack. Works very well in Delphi XE2 Professional.

However when I run a bit of code that worked fine in Delphi 2010 I now get an exception notification when adding a calibration point with AddCalibpoint (3rd method).
... 'Component Geomap: current calibration model does not support this version of AddCalibPoint'. After that I can continue and the map image loads, but geofunctions like Calc pixels and lat/long do not work.

The part of the code that calls AddCalibPoint reads:
Code:
calLat:=StrToFloat(OziStringGrid.Cells[6,i])+(StrToFloat(OziStringGrid.Cells[7,i])/60);
if OziStringGrid.Cells[8,i]='S' then calLat:=0-calLat;
calLong:=StrToFloat(OziStringGrid.Cells[9,i])+(StrToFloat(OziStringGrid.Cells[10,i])/60);
if OziStringGrid.Cells[11,i]='W' then calLong:=0-calLong;
valid:=Geomap.AddCalibPoint(calLat,calLong,StrToInt(OziStringGrid.Cells[2,i]),StrToInt(OziStringGrid.Cells[3,i]));


Geomap calibration is set to cmBiquadraticPn.

Loading maps which already have a XML file works fine.

Can you help me solve this?

Yours sincerely,

Jaap
Code:
Code:

_________________
Jaap van Goor
Promanent b.v.
Back to top
View user's profile Send private message Visit poster's website
hlohning



Joined: 08 Sep 2006
Posts: 277
Location: Austria

PostPosted: Sat Oct 29, 2011 7:21 pm    Post subject: Reply with quote

Jaap,

this exception is raised only if the calibration model is set to a wrong value (or not set at all). Following is part of the source code of the AddCalibPoint method:

Code:

begin
if (FCalibModel <> cmBiquadraticPn) and (FCalibModel <> cmConicConformal) and
   (FCalibModel <> cmMillerCylindrical) and (FCalibModel <> cmEquiRect) then
  raise ESDLGeoMapError.Create ('Component "'+Name+'": current calibration model does not support this version of AddCalibPoint');
result := false;
if FCalibData.NumCalQuads < MAXCALQUADS then
  begin
  inc (FCalibData.NumCalQuads);
  FCalibData.CalQuads [FCalibData.NumCalQuads].Latitude := Latit;
  FCalibData.CalQuads [FCalibData.NumCalQuads].Longitude := Longit;
 
  ....(snip)

  CalcExtentsAndResolution;
  result := true;
  end;
Paint;
end;


As you can see, the exception is only raised if the calibration model is not one of the four allowed.

Hope this helps,

Hans
_________________
Hans Lohninger
Software Development Lohninger
http://www.lohninger.com/
Back to top
View user's profile Send private message Visit poster's website
jvgoor



Joined: 07 Sep 2011
Posts: 42
Location: Maasland, The Netherlands

PostPosted: Sun Oct 30, 2011 12:23 pm    Post subject: Reply with quote

Hans,

Many thanks for the tip. I checked my code and I did a Geomap.Clear and a Geomap.ClearCalibrationData and did not realize that this would also delete the CalibModel property.

It now works fine.

Greetings,

Jaap
_________________
Jaap van Goor
Promanent b.v.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.sdlsuite.com Forum Index -> GeoPack All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group