[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
www.undertowsoftware.com • View topic - GeoFind and GeoFindArray

GeoFind and GeoFindArray

A forum made available for users of the MapPro OCX SDK to exchange ideas, ask each other questions, etc.

GeoFind and GeoFindArray

Postby VictorC » Tue May 25, 2010 11:24 pm

I got some help using GeoFind, a while ago in this forum. I am trying to figure out the differenced between GeoFind and GeoFindArray and I am having a hard time. I also tried to translate the Delphi code in the manual to VB, so I can play with it and see if I can figure it out, but my code doesn't even compile with an error that an object is not defined. I was wondering if anyone can explain the difference in simple words and if they have some VB code they want to share.
User avatar
VictorC
Active User
Active User
 
Posts: 29
Joined: Sun Jan 24, 2010 2:54 pm

Re: GeoFind and GeoFindArray

Postby Gyrotech » Wed May 26, 2010 9:17 am

VictorC wrote:I got some help using GeoFind, a while ago in this forum. I am trying to figure out the differenced between GeoFind and GeoFindArray and I am having a hard time. I also tried to translate the Delphi code in the manual to VB, so I can play with it and see if I can figure it out, but my code doesn't even compile with an error that an object is not defined. I was wondering if anyone can explain the difference in simple words and if they have some VB code they want to share.

Based on conversations I had with the undertow main developer, Steve, years ago, the functions are supposed to be the same. The difference is that geofind fires an event and geofindarray does not, so it can handle situations where events can't be hooked into.

If you are interested, I can dig out some old code I had gotten from Steve, at the time, but it will be for VB5 or VB6, not the newer VB.Net flavor. Also, what is the object error you are getting? It may help identify the problem.
User avatar
Gyrotech
Frequent User
Frequent User
 
Posts: 52
Joined: Mon May 03, 2010 11:23 pm

Re: GeoFind and GeoFindArray

Postby VictorC » Thu May 27, 2010 2:53 pm

Thanks, Gyrotech. My application is visual, so I'm wondering which would be a better one to use. Would you happen to have any VB code for the Geofind Array? That may help me decide what to use :-)
User avatar
VictorC
Active User
Active User
 
Posts: 29
Joined: Sun Jan 24, 2010 2:54 pm

Re: GeoFind and GeoFindArray

Postby Gyrotech » Fri May 28, 2010 11:46 am

VictorC wrote:Thanks, Gyrotech. My application is visual, so I'm wondering which would be a better one to use. Would you happen to have any VB code for the Geofind Array? That may help me decide what to use :-)

Well, I don't know which is better to use, you have to decide :-) I do have some code that we had used when we were testing for our app. It was about a year and a half ago, with the SDK release 2 at the time, so I am not sure if all the comments apply, but feel free to delete them if they don't :-) FWIW, after our testing, we decided not to use the geofindarray, anyway :-)

Private Sub CreateStreetList_Click()
'-------------------------------------------------------------------------------
' First thing you want to do is make sure the Data Paths are set correctly
' Most of the errors I have encountered in searching, when using this program,
' have been because I set my data paths wrong. If you are certain you have set
' the paths correctly somewhere else in your code, you can skip this section
'-------------------------------------------------------------------------------
MapPro1.Path_states0 = "\\Server\MyData\States"
MapPro1.Path_data1 = "\\Server\MyData\Data1"
MapPro1.Path_data2 = "\\Server\MyData\Data2"
MapPro1.Path_data3 = "\\Server\MyData\Data3"
'-------------------------------------------------------------
' Though not needed, set Path_Data1 as well (what does it do ??)
'-------------------------------------------------------------
MapPro1.Path_states1 = "\\Server\MyData\States"
'----------------------------------------------------------------------
' Make the ToolBar Visible, in fixed mode in case you need to zoom, etc.
'------------------------------------------------------------------------
MapPro1.ToolbarMode = TbFix
'-------------------------------------------------------------------------
' Set DataSource to use the GTD data for USA only (that's all we are using)
'---------------------------------------------------------------------------
MapPro1.DataSource = ZPG_GDTUSA
'------------------------------------------------------------------------------------
' Make sure AutoConfig is set to False (this will not have any affect
' until after the app is run once, exited and re-run) I use this because VB6 messes
' me up all the time by loading the file and resetting all my option, if it's true
'------------------------------------------------------------------------------------
MapPro1.AutoConfig = False
'---------------------------------------------------------------------------
' Set the scale to 1 mi (so that local street data is visible) and
' Zoom to a specific area (Springfield, MO. You do not necessarily need to
' do that, but I have found that it sometimes makes the search faster
' if you zoom to the area of interest (Is that true?)
'---------------------------------------------------------------------------
MapPro1.Miles = 1
MapPro1.GotoPoint -93.317, 37.183

Dim s As MapPro71.StreetsArray
Dim i As Integer
Dim StNum, Str, City, State, Zip As String
'---------------------------------------------------------------------------------
' Set a StreetsArray record to get the results of the search
' Search of all street blocks that are part of Campbell Ave. in Springfield
' ** Here I have to say that I have no idea why the search works the way it does.
' ** It finds all the South Campbell Ave blocks but NONE of teh North Campbell Ave
' ** I had called undertow months ago and was told that someone would get
' ** back to me, but you know what that means from software companies... never,
' ** so they never did. I eventually worked around it by doing two searches,
' ** one for S. Campbell and one for N. Campbell, bu I really shouldn't have to
'---------------------------------------------------------------------------------
Set s = MapPro1.GeoFindArray("Campbell Ave, Springfield,mo")
'------------------------------------------------------------
' Display the number of street blocks returned in a list box
'------------------------------------------------------------
List1.AddItem "Total Number of street blocks Returned: " & s.Count
'-----------------------------------------------------------------
'Extract some of the Street block info and list it in the Listbox
'-----------------------------------------------------------------
For i = 0 To s.Count - 1
StNum = s.Streets(i).Address
Str = s.Streets(i).Name
City = s.Streets(i).City
State = s.Streets(i).State
Zip = s.Streets(i).ZipCode
List1.AddItem "[" & i & "]" & StNum & " " & Str & ", " & City & ", " & State & ", " & Zip
Next i
End Sub
User avatar
Gyrotech
Frequent User
Frequent User
 
Posts: 52
Joined: Mon May 03, 2010 11:23 pm


Return to MapPro OCX

Who is online

Users browsing this forum: No registered users and 2 guests

cron