Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a link (like a hyperlink) from a table to a scanned map 3

Status
Not open for further replies.

EH

Programmer
Sep 17, 2001
9
AU
Hi there,
I'm scanning sections of a street map, where the street name and suburb will exist in tables in delphi (V5).
What I wish to happen is that, the user will have a pop up table, type in a street name or suburb, when found, a field will exist to enable the user to view the street and suburb on a map.
1. I need to know if delphi can handle scanned street maps
2. What is the best file format for the scanned street map for delphi
2.1. What is the best component to use
3. Is there a way to link the street name and suburb in the table to the scanned street map.
4. Similarly, have a reverse link to a from the street map to another table.
Any help would be greatly considered

 
Do a search on the key words Delphi GIS I found
among others and they sell an activeX control.
I know that GIS software is not cheap, but maybe you can find something.

I use just plain Autocad dwf files with an ActiveX from Adesk called Whip
Regards S. van Els
SAvanEls@cq-link.sr
 
If I was doing this I would write the program to use the map reference codes (X, Y) coordinates as the link between places and their corresponding street map. This way when the user types in a place, you can locate it in the table and check its map grid reference to decide which map to display. The only time consuming part of doing it this way is the constructing of a table containing all the places and their map coordinates but Im sure somebody out there will already have done this.

Also, doing it this way means you can display your actual maps in a simple TImage.
 
Hi there,

Thankyou for my previous response concerning mapping.

Another issue as occurred.
I'm in contact with a governemnt department who is willing to supply me maps in softcopy format.
However, they want to know what file extensions delphi is compatible with.
Could you please let me know what file extensions delphi is compatible with when it comes to importing mapping files.

I've attached a copy of their comments below.
(PS not sure why they would think I would use access or paradox, when I intend to use delphi for programming)

"Erwin,
Digital vector data from LPINSW such as contours, drainage, etc is formatted to suit GIS or computer drafting packages, such as Mapinfo, Arcinfo, Autocad, Microstation, etc. Cadastral data would fall in this category.
Raster data such as image data (scanned aerial photographs, etc) are usually supplied in formats such as TIFF, jpeg, GIF, etc. You have mentioned that you require street and address data. Before we look at what LPINSW can do for you, it will be necessary for you to investigate what GIS software is available for you and what formats are compatible. You should note that if street addresses can be obtained for the subject area, these would probably be supplied as an ASCII listing, and would need to be related to the graphic representation of the cadastre or property
subdivision to be of any benefit. LPINSW cannot supply data for use with Paradox or MSAccess, as these are not recognised GIS software. Please advise as soon as possible and I will be ready to assist you with your request."
 
I think you will find with the right units imported into Delphi, it will read just about anything.

My version currently has the ability to read jpg and gif files because I am using units written by other programmers (and imported into Delhi.)

Although I have had delphi reading Tiff files - I cant remember where I found the unit to enable it to do so - therefore I would advise agaisnt that one. So in general, check out one of the many Delphi Sites and do a search for "jpg". You will probably find all you need to help Delpho read these (and other) formatats that way.

It does really depend on what quality you want in the end I guess, but my choice would be jpg (gif files can be problematic.) Anyway, check these lnks out - you may find them useful.


and


Cheers..
 
Greeting to you all,

Thankyou for all your responses. Its been great!

This question may seem trivial to some, however if you can help please
do.
Is there a way of substituting the object name, such as 'Label1' for
varaible so that it then can be used in the loop?
eg.
Say i have 10 labels, label1 .. label10, and i want to change their
caption in the 'for' or 'while' loop: for x := 1 to 10 do
labe1.caption := x;
how do i change label1 to label2 in the next iteration.

Thank you
 
To change several labels' captions :-

for j := 0 to ComponentCount-1
begin
if components[j] is TLabel then
(Components[j] as TLabel).caption := 'summit';
end;

If there are certain labels you only want to change at certain times, you could use the Tag property and check for certain values in that.

lou
 
Hi there,

We are trying to use a radio group component as a dynamically created object that is to enable us to make a selection of one from three buttons for say 50 people. We are having troubles doing a select all, making different selection cobinations, using the combo boxes and then posting the information to an access table. See details below.

Thanks Erwin

1. Situation
1.1. We have sales representatives (SR) (50-60 SR’s) that are required to complete a campaign.
1.2. There are 18 campaigns (Cmp) for the year. There are 10 groups of SR’s.
1.3. We have used combo boxes that will 1. Select the year, 2. Select the Cmp (1 to 18). 3. Select the group (1-10). One the selections are made a button is pressed.
1.4. This brings up on the form, a dynamically created object (radio boxes), showing 3 buttons (button 1 – completed, button 2 – missed button 3 – suspended), for each of the SR’s in that group.
1.5. Only one of the 3 button can be chosen. Once selected press a save button. This information is registered in a database.

2. Problem
We have been able to create the above but cannot do the following:
2.1. Only press one of the three buttons (not be able to select all three buttons).

2.2. If there are 50 SR’s how do we do a select all for say, the completed button (or missed button etc), or do a deselect all. (we can only press one button at a time).

2.3. Once selections have been made, how is this posted this into an access table, as an integer.
2.3.1. We would like the button selection, to show as an integer (say one) to allow for calculations to be perofrmed.
2.3.2. A typical calculation is e.g. So in one year (18 Cmp’s) a SR will have completed 10, missed 4, suspended 4 (total 18).
2.3.3. The calculation ill be carried out by an sql query.

2.4. How can you refresh and choose another combo box combination, to then show a different group of SR’s.

3. We have used the Radio group component as a dynamically created object.

4. A copy of the code is attached that reflects point 1.
procedure TfrmCampSrep.FormActivate(Sender: TObject);
var
i: integer;
begin
DmAvon1.tblTA.close;
DmAvon1.tblTA.open;
DmAvon1.tblTA.First;
ComboBox1.Items.clear;
while not DmAvon1.tblTA.Eof do
begin
combobox1.Items.Add(inttostr(dmAvon1.tblTa.fieldbyname('TmArId').asinteger));
dmAvon1.tblTA.Next;
end;
DmAvon1.tblTA.close;

for i := 1 to 18 do
begin
ComboBox3.Items.Add(inttostr(i));
end;
ComboBox3.ItemIndex := -1;

DmAvon1.tblCamp.close;
DmAvon1.tblCamp.open;
DmAvon1.tblCamp.First;
ComboBox2.Items.clear;
if dmAvon1.tblCamp.fieldvalues['CmpYr'] = NULL then
begin
dmAvon1.tblCamp.Close;
showmessage('There is no data to show'#13+
'First establish some campaigns in Campaign Setup Screen.');
exit;
end
else
begin
tempyear := dmAvon1.tblCamp.fieldvalues['CmpYr'];
ComboBox2.Items.add(inttostr(tempyear));
while not dmAvon1.tblCamp.Eof do
begin
if dmAvon1.tblCamp.fieldvalues['CmpYr'] <> tempyear then
begin
ComboBox2.Items.add(dmAvon1.tblCamp.fieldvalues['CmpYr']);
tempyear := dmAvon1.tblCamp.fieldvalues['CmpYr'];
dmAvon1.tblCamp.Next;
end
else
begin
dmAvon1.tblCamp.Next;
end;
end;
end;
dmAvon1.tblCamp.Close;

end;

procedure TfrmCampSrep.Button3Click(Sender: TObject);
var
i, x, y: integer;

begin
repsarray := nil;
if ComboBox1.Text = '' then
begin
showmessage('Team Area must be selected');
ComboBox1.SetFocus;
Exit;
end
else
begin
taid := strtoint(comboBox1.text);
end;

if ComboBox2.Text = '' then
begin
showmessage('Campaign Year must be selected');
ComboBox2.SetFocus;
Exit;
end;

if ComboBox3.Text = '' then
begin
showmessage('Campaign Number must be selected');
ComboBox3.SetFocus;
Exit;
end;

x := 390;
y := 130;
rep_count := 0;
i := 1;

while i <> ComponentCount + 1 do
begin
if Components.Name = 'RadioGroup' + inttostr(i) then
begin
TRadiogroup(Components).Destroy;
end
else
begin
inc(i);
end;
end;

dmAvon1.SQLCampSrep.Close;
dmAvon1.SQLCampSrep.Parameters.ParamByName('Taid').Value := taid;
dmAvon1.SQLCampSrep.Open;
rep_count := dmAvon1.SQLCampSrep.RecordCount;
SetLength(repsarray, rep_count);
dmAvon1.SQLCampSrep.First;

if rep_count = 0 then
begin
showmessage('No data to display.');
exit;
end;

for i := 0 to rep_count - 1 do
begin
with TRadioGroup.Create(self) do
begin
parent := self;
left := x;
top := y;
width := 300;
height := 41;
columns := 3;
items.add('Completed');
items.add('Missed');
items.add('Suspended');
caption := ' ' + dmAvon1.SQLCampSrep.fieldvalues['SRepFNm'] +
' ' + dmAvon1.SQLCampSrep.fieldvalues['SRepLNm'] + ' ';
color := clMoneyGreen;
end;
repsarray := TRadioGroup(Self);
y := y + 48;
dmAvon1.SQLCampSrep.next;
end;
dmAvon1.SQLCampSrep.close;
end;

procedure TfrmCampSrep.Button2Click(Sender: TObject);
begin
frmMainMenu.show;
frmCampSrep.close;
frmCampSrep.release;
frmCampSrep := nil;
end;

end.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top