Having Problems with LinkData w/ Addresses

mrobold
11-11-2003, 12:11 PM
Trying to use LinkData (in an attempt to lower my memory usage), and while the routine that imports the data based on Lat/Lon info works fine, the routine that bases plotting on addresses doesn't seem to pull the street address.

The text file is as follows:


Address1 City Region Info1 Info2 Info3 Info4 Info5
841 N. MAIN ST CORONA CA Foo1 Foo2 Foo3 Foo4 Foo5


The import seems to get the City and Region, but not the address. Have tried using different headers (Street, Street Address, Street address, Address), and none of them seem to work...the pushpins all end up in the center of the city.

I even tried building a field array to pass so I could specify what the street address data was, but that didn't work either.


Dim fieldArray As Array = Array.CreateInstance(GetType(Object), 8, 2)
fieldArray.SetValue("Address1", 0, 0)
fieldArray.SetValue(MapPoint.GeoFieldType.geoField Address1, 0, 1)
fieldArray.SetValue("City", 1, 0)
fieldArray.SetValue(MapPoint.GeoFieldType.geoField City, 1, 1)
fieldArray.SetValue("Region", 2, 0)
fieldArray.SetValue(MapPoint.GeoFieldType.geoField Region1, 2, 1)
fieldArray.SetValue("Info1", 3, 0)
fieldArray.SetValue(MapPoint.GeoFieldType.geoField Data, 3, 1)
fieldArray.SetValue("Info2", 4, 0)
fieldArray.SetValue(MapPoint.GeoFieldType.geoField Data, 4, 1)
fieldArray.SetValue("Info3", 5, 0)
fieldArray.SetValue(MapPoint.GeoFieldType.geoField Data, 5, 1)
fieldArray.SetValue("Info4", 6, 0)
fieldArray.SetValue(MapPoint.GeoFieldType.geoField Data, 6, 1)
fieldArray.SetValue("Info5", 7, 0)
fieldArray.SetValue(MapPoint.GeoFieldType.geoField Data, 7, 1)

' Create the Units dataset
Dim ds As MapPoint.DataSet
ds = Me.ActiveMap.DataSets.LinkData(Me.AppPath & "\inc.tmp", "IncNo", fieldArray, MapPoint.GeoCountry.geoCountryMultiCountry, MapPoint.GeoDelimiter.geoDelimiterTab, 0)


Any help here would be greatly appreciated.

MR

Cubistix
11-12-2003, 01:36 PM
Hey,

Don't Assign your Address1 in the 0 (Zero) position of the Array. That probably should fix your problem.. Try leaving the Zero slot blank.

-Mark

 
Web mp2kmag.com
mapforums.com