Autor Beitrag
Muck
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 98
Erhaltene Danke: 8

Win 8, Win 7, Vista, Win XP
Delphi XE3, Delphi 2009, Delphi 2007, Delphi 5
BeitragVerfasst: So 28.09.08 00:13 
Hallo,

ich habe ein image einer Karte der USA und eine Datenbank mit altitud und longitud jeder PLZ.

Wenn ich nun Punkte der Datenbank auf der Karte anzeige so entsteht eine Verzerrung, die Punkte im Norden sind zu weit aussen, also im Meer :-) und die Punkte suedlich nach innen. Ist ein paar Jahre her, dass ich Mathe in der Schule hatte, aber es wird wohl mit der Berechnung von Punkten auf der Oberflaeche einer Kugel zutun haben.

Ich habe von einem Ausgangspunkt der Karte die Pixel je West Ost Sued und Nord errechnet und zeige jeweils einen roten Punkt an. Die enstandene Grafik Beispiel.jpg ist in der Anlage.

Nun hat jemand eine Idee, wie die Formel in Calc2 aussehen muesste?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
Procedure Calc2(a,o:Extended);
begin
a:=625-(a-25.954533)*26.5;
O:=2+(o+124.402914)*20.34;
Form1.Image1.Canvas.Pixels[Round(o),Round(a)]:=$020000FF;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
Table1.TableName:='zip.dbf';
Table1.Active:=true;
while not table1.eof do begin
  Calc2(table1['latitude'],table1['longitude']);
  table1.next;
end;
table1.active:=false;
end;


Danke Markus

Moderiert von user profile iconmatze: Code- durch Delphi-Tags ersetzt
Einloggen, um Attachments anzusehen!
platzwart
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1054
Erhaltene Danke: 78

Win 7, Ubuntu 9.10
Delphi 2007 Pro, C++, Qt
BeitragVerfasst: So 28.09.08 01:21 
hmm... kannst net einfach die darunter liegende karte entsprechend drehen? ^^
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: So 28.09.08 10:00 
Hmm.. Und dann im notfall auch gleich zurückdrehen, das wird wahrscheinlich sogar noch performanter sein

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)