ThinkGeo.com    |     Documentation    |     Premium Support

Geocoding

Hello,


I would like to know if using map suite geocoder I could find Lat/Long from any SHP file, if this is posible could you make an example about how to do that.


Tanks you very much for your answer,


Leandro



Leandro, 
  
 If you need to find lat/long from shape files, you need to create an index file based on your data sources,then you need to create a custom DbfMatchingPlugIn class to match. You can check out our “How Do I Sample” after you installed the product. 
  
 If you have any questions please let me know, 
  
 Thanks,

Hi, 
  
 We have purchased web edition but the geocoding algorithm we are using has some performance issues.  We have clients from different part of the world and we are provided the map data from our clients in mostly shapefiles.  We need to achieve the following: 
  
 1) GPS to address.  We are currently using OpenLayer in web edition.  Does Geocoder find address by GPS coordinates in a faster manner?  Does it find the address to the nearest street number or to the nearest blockface? 
 2) Street to GPS.  I saw postings in another topic about providing free form addresses.  Would you provide some brief information how it works. 
 3) Does Geocoder support routing?  If not, what product is available that I can consider? 
  
 Thanks, 
 Tracy

Tracy, 
  
 Thanks for your post, here are my answers for your questions below: 
  
 1, GPS to address: 
  The MapSuite Geocoder can find address by GPS coordinates and it can find the nearest street number. When you GPS to address, you need to pass the coordinates one by one, then the Reverse Geocoder can find the nearest street number what you want,  please see the construction of Reverse Geocoder: 
  
 
UsaGeocoder usaGeocoder = new UsaGeocoder(indexDataPath);
usaGeocoder.Open();

String coordinate = “-95.234299, 38.976492”;
MatchResult result = usaGeocoder.Match(coordinate);
usaGeocoder.Close();
 
  
 If the pass parameter is a coordinate format, the Geocoder would formalize the parameter first and match the result according to the pass parameter. 
  
 In addition, if you want to get the nearest blockface, you mean the census block face?  You need to pass the parameter as the following format: 
  
 CensusBlock: 1000:010900,  
  
 It matches this format: CensusBlock: 1000(CensusBlockID): 010900(CensusTractID). 
  
 So you realize if we just pass the coordinate string to match, it only can find the nearest street, can not find the nearest blockface, we have to pass the special format to find the bockface. 
  
 2, Street to GPS: 
  
 Currently, we support these plugins to match result: 
  
 StreetDbfMatchingPlugin, ReverseDbfMatchingPlugin, ZipDbfMatchingPlugin, CityDbfMatchingPlugin, CountyDbfMatchingPlugin, StateDbfMatchingPlugin, SoundexDbfMatchingPlugin, PostcodeDbfMatchingPlugin, CensusTractDbfMatchingPlugin, CensusBlockDbfMatchingPlugin, CensusBlockGroupMatchingPlugin. 
  
 They are all belonged to the UsaGeocoder object, when you use the UsaGeocoder object to match an address; it would through these plugins above and return to you the best results. 
  
 3, The Geocoder product dose not support routing, currently, we have an MapSuite routing extension, please check the link below for routing extension: 
  
 gis.thinkgeo.com/Products/ExtensionsAddOnsforMapSuite/MapSuiteRouting/tabid/723/Default.aspx 
  
 Thanks,

Hi, 
  
 Just want to make sure. UsaGeocoder does not only support USA or North America data only, does it?  
  
 Thanks, 
 Tracy

Hi,


I have a shape file for province/state features, a shaple file for citie, a shape file for streets; can you give an example to show how to create an index file , and make a custom DbfMatchingPlugIn to use for address look up (like on google map)?


 


Thanks!


Lishan


 


 



Tracy, 
  
 About your question, currently, in our MapSuiteGeocoder 3.0, it only supports USA, we just created the index file for entire USA, not includes the other countries, but you can create your own index file for the other country if you can get the data source for any other contries. 
  
 Thanks, 
  
 Scott,

Lishan, 
  
 Thanks for your post, please see my sample code below for creating your own index file: 
  
 
// Create your own index dbf file.

            // Define a Collection of DbfColumnDefinition
            Collection<DbfMatchingPluginColumn> columns = new Collection<DbfMatchingPluginColumn>();

            // Add necessary columns into the collection
            columns.Add(new DbfMatchingPluginColumn("ID_State", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.String, 54));
            columns.Add(new DbfMatchingPluginColumn("DT_City", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.String, 2));
            columns.Add(new DbfMatchingPluginColumn("DT_County", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.String, 2));
            columns.Add(new DbfMatchingPluginColumn("BB_CX", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
            columns.Add(new DbfMatchingPluginColumn("BB_CY", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
            columns.Add(new DbfMatchingPluginColumn("BB_ULX", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
            columns.Add(new DbfMatchingPluginColumn("BB_ULY", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
            columns.Add(new DbfMatchingPluginColumn("BB_LRX", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
            columns.Add(new DbfMatchingPluginColumn("BB_LRY", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));

            // Create the MatchDbf object according to the path and the collection of DbfColumnDefinition
             DbfMatchingPlugin.CreateDbf(@"C:\SampleData\sampleIndex.dbf", columns);
             DbfMatchingPlugin matchingPlugIn = new DbfMatchingPlugin(@"C:\SampleData\sampleIndex.dbf", DbfMatchingPluginReadWriteMode.ReadWrite);
         
           // Open the index dbf file and add records.
           matchingPlugin.Open();
           for(int i = 0; i < yourDataSourceRows.Count; i ++)
           {
                matchingPlugin.AddRecord(new object[] {sourceState, sourceCity, sourceCounty, sourceBB_CX, sourceBB_CY, sourceBB_ULX, sourceBB_ULY, sourceBB_LRX, sourceBB_LRY});
             }
            matchingPlugin.Close();
 
  
 This is just a sample to show you how to create your own index dbf file for the state shape file, when you added the actual record to the new index dbf file, you need to change the code above for adding the actual data from your shape file. 
  
 Also about your second question, when we execute the Match operation, it will return a GeocoderMatch collection, it includes all matches results and the best result will be placed on the top. If you are interested in it, please check this link:maps.thinkgeo.com, it shows the addresses like google map. 
  
 Thanks, 
  
 Scott,

hi Scott,  
  
 Type DbfMatchingPluginColumn can’t be resolved… should it be available with ThinkGeo.MapSuite.MapSuiteGeocoder?  
  
 Thanks, 
 Lishan

Lishan, 
  
 I’m sorry to tell you about the DbfMatchingPluginColumn object, it is included in the new release of MapSuiteGeocoder, in the old versions you should use the DbfColumnDefinition class, they are almost the same, but for your requirements, there are not any diferents between them, also the new release of MapSuiteGeocoder is public, if you would like to get it please contact ThinkGeo Support or download the evaluation edition to try first. 
  
 If you have any questions please let me know, 
  
 Thanks, 
  
 Scott,

Hi Scott,



I installed the latest version.



Microsoft JScript runtime error: Sys.Net.WebServiceFailedException: The server method 'findAddress' failed with the following error: System.FormatException-- Input string was not in a correct format.



somehow, I keep getting the above error...



I am creating the dbf from a street shape file.. my code is attached. 



1707-code.txt (4.19 KB)

thanks! 
 Lishan

Lishan, 
  
 I have read you code, it seems there are not any problems on your source code, maybe the exception is from your shape file,  can you make sure the dbf column types are matched to the insert record.  
  
       
// Add necessary columns into the collection
            columns.Add(new DbfMatchingPluginColumn(“ID_Street”, ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.String,54));
            columns.Add(new DbfMatchingPluginColumn(“DT_LREFADDR”, ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Integer,2));
            //columns.Add(new DbfMatchingPluginColumn(“DT_Province”, ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.String, 2));
            columns.Add(new DbfMatchingPluginColumn(“BB_CX”, ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Double, 10));
            columns.Add(new DbfMatchingPluginColumn(“BB_CY”, ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Double,10));
            columns.Add(new DbfMatchingPluginColumn(“BB_ULX”, ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Double,10));
            columns.Add(new DbfMatchingPluginColumn(“BB_ULY”, ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Double,10));
            columns.Add(new DbfMatchingPluginColumn(“BB_LRX”, ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Double,10));
            columns.Add(new DbfMatchingPluginColumn(“BB_LRY”, ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Double,10));
 
  
 It is the definition for your dbf columns, I think the BB_CX, BB_CY, BB_ULX, BB_ULY, BB_LRX and BB_LRY formats are correct, but I’m not sure the DT_LREFADDR format is correct, please check them again, if you can’t find out the problem exactly please give me your shape file so that I can reproduce your problem and help you to fix it. 
  
 Thanks, 
  
 Scott,

Hi Scott,


I have tried w/o the DT_LREFADDR column, i still get the same error.


I have attached a the files (a smaller city.. smaller files)


another question .. 


as you can see, the shape file comes with the dbf file.. could that dbf be used with dbfmatchingplugin?  cuz right now,I have to get the center Lon, lat, bounding box of the features from the feature sources which could take a very long time if the shape file gets really big..  in fact, I have tried that with a street shape file with 2 million records, the operation (getting the center lon, lat, bounding box of the features was still not done after 30 min..and the computer basically froze ) .. is there any better way to do this you would suggest?


 


Thanks!


 


Lishan



1714-shapefile.zip (53.4 KB)

Lishan,


I createD the index dbf file based on the attached shape file, the columns for the index dbf file are "ID_LINK", "DT_NAME", "BB_CX", "BB_CY", "BB_ULX", "BB_ULY", "BB_LRX", "BB_LRY", please see the following code for creating the index dbf file:




string streetLayerShapeFile = txtShpFile.Text;
            Collection streetFeatures = null;
            ShapeFileFeatureLayer streetLayer = new ShapeFileFeatureLayer(streetLayerShapeFile);

            Collection columns = new Collection();

            // Add necessary columns into the collection
            columns.Add(new DbfMatchingPluginColumn("ID_LINK", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.String, 10));
            columns.Add(new DbfMatchingPluginColumn("DT_NAME", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.String, 20));
            columns.Add(new DbfMatchingPluginColumn("BB_CX", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
            columns.Add(new DbfMatchingPluginColumn("BB_CY", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
            columns.Add(new DbfMatchingPluginColumn("BB_ULX", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
            columns.Add(new DbfMatchingPluginColumn("BB_ULY", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
            columns.Add(new DbfMatchingPluginColumn("BB_LRX", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
            columns.Add(new DbfMatchingPluginColumn("BB_LRY", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));

            // Create the MatchDbf object according to the path and the collection of DbfColumnDefinition
            DbfMatchingPlugin.CreateDbf(@"C:\Documents and Settings\administrator\Desktop\testShape.dbf", columns);
            DbfMatchingPlugin matchingPlugIn = new DbfMatchingPlugin(@"C:\Documents and Settings\administrator\Desktop\testShape.dbf", DbfMatchingPluginReadWriteMode.ReadWrite);

            streetLayer.Open();
            streetFeatures = streetLayer.FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns);


            int count = streetFeatures.Count();

            String[] IDLink = new string[count];
            string[] stName = new string[count];
            Double[] BB_CX = new Double[count];
            Double[] BB_CY = new Double[count];
            Double[] BB_ULX = new Double[count];
            Double[] BB_ULY = new Double[count];
            Double[] BB_LRX = new Double[count];
            Double[] BB_LRY = new Double[count];

            List sortList = new List();
            for (int i = 0; i < count; i++)
            {
                IDLink[i] = streetFeatures.ElementAt(i).ColumnValues["LINK_ID"];
                stName[i] = streetFeatures.ElementAt(i).ColumnValues["ST_NAME"];
                BB_CX[i] = streetFeatures.ElementAt(i).GetBoundingBox().GetCenterPoint().X;
                BB_CY[i] = streetFeatures.ElementAt(i).GetBoundingBox().GetCenterPoint().Y;
                BB_ULX[i] = streetFeatures.ElementAt(i).GetBoundingBox().UpperLeftPoint.X;
                BB_ULY[i] = streetFeatures.ElementAt(i).GetBoundingBox().UpperLeftPoint.Y;
                BB_LRX[i] = streetFeatures.ElementAt(i).GetBoundingBox().LowerRightPoint.X;
                BB_LRY[i] = streetFeatures.ElementAt(i).GetBoundingBox().LowerRightPoint.Y;
                sortList.Add(string.Format("{0},{1},{2},{3},{4},{5},{6},{7}", IDLink[i], stName[i], BB_CX[i], 
                                        BB_CY[i], BB_ULX[i], BB_ULY[i], BB_LRX[i], BB_LRY[i]));
            }

            streetLayer.Close();

            // Open the index dbf file and add records.
            matchingPlugIn.Open();

            sortList.Sort(delegate(string lineA, string lineB)
            { return lineA.Split(',')[0].CompareTo(lineB.Split(',')[0]); });

            foreach(string record in sortList)
            {
                string[] parts = record.Split(',');
                string idLink = parts[0];
                string streetName = parts[1];
                int bb_Cx  = int.Parse((double.Parse(parts[2]) * coordinatesMultiplier).ToString());
                int bb_Cy = int.Parse((double.Parse(parts[3]) * coordinatesMultiplier).ToString());
                int bb_Ulx = int.Parse((double.Parse(parts[4]) * coordinatesMultiplier).ToString());
                int bb_Uly = int.Parse((double.Parse(parts[5]) * coordinatesMultiplier).ToString());
                int bb_Lrx = int.Parse((double.Parse(parts[6]) * coordinatesMultiplier).ToString());
                int bb_Lry = int.Parse((double.Parse(parts[7]) * coordinatesMultiplier).ToString());
                matchingPlugIn.AddRecord(new object[] { idLink, streetName, bb_Cx, bb_Cy, bb_Ulx, bb_Uly, bb_Lrx, bb_Lry});
            }

            matchingPlugIn.Close();


I attached the index dbf file to you, please check it according to the code above. 

Also about your another question: 

the shape file comes with the dbf file.. could that dbf be used with dbfmatchingplugin? 


The dbf file with the shape file cannot use to dbfmatchingplugin, this dbf file is not diferent from the index dbf file, we need to create index dbf file for Geocoder, when you create the index dbf file, you have to consider these points:


1, Determine an ID key for the index dbf file. In this sample, I used the "LINK_ID" field of shape's dbf file as my key and the key column name must to contain "ID_" so that it can match records according to the key values.

2, Sort the key values, this is important, the reason is that it would process the binary search in the index dbf file, if you didn't sort the key values, the binary search functionality cannot find out the matched results correctly.

3, When you stored the center longitude, latitude or bounding box of the feature, you need to multiply by 1000000 and their column type are ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, not double, the reason is that it can increase the build performance and reduce the size of index dbf file. I build the index dbf file just used about 10 seconds.


If you have any questions please let me know,


Thanks,


Scott,



1719-testShape.zip (12.1 KB)

Hi Scott,



1. Thank you. I am able to create the dbf index file from small shape files..  but when it gets to create from big files like 300mb (streets shape file that contains all Canadian streets info).. it won't work. It froze my computer and it used up the memory in 30 min where I had to end the process forcefully.  Any suggestion for this (it'd be great if I can do this w/o splitting the big area shape files into small areas )? 



2. I am using Geocoder to find match to my input.   I am doing the following :



 
 Geocoder geocoder = new Geocoder(dbfPath);
 geocoder.MatchingPlugIns.Add(new DbfMatchingPlugin(dbfPath +"\\" + "sreets.dbf"));
 Collection<geocodermatch> matchResult;

  try
   {
   geocoder.Open();
   matchResult = geocoder.Match(input);
          }
finally 
 {
 geocoder.Close();
 }

 
 

I can only find the exact match.. how can I use fuzzy Match. Do I need to create a custom dbfMatchingPlugin to do that? how can I enable the MatchMode.Fuzzy with it? 



Thanks!



Lishan



continue the prev post 
  
 3. if I want the result to return also the city, state, country names which a street belongs to… (collection of results by fuzzy match)… Should I create the dbf index file for the city, province, country layers and add the CityMatchingPlugin etc to the Geocoder? 
  
 Thanks! 
 Lishan

Lishan,


Thanks for your post, please see my comments for your 3 questions below:
 
1. Thank you. I am able to create the dbf index file from small shape files,  but when it gets to create from big files like 300mb (streets shape file that contains all Canadian streets info). It won't work. It froze my computer and it used up the memory in 30 min where I had to end the process forcefully. Any suggestion for this (it'd be great if I can do this w/o splitting the big area shape files into small areas )?
 
I think the record count of your street shape file is too large, so this is truth, I think you can't use the streetLayer.FeatureSource.GetAllFeatures method to get all record features, it would cause your computer crash, there is a work around for this problem, please see me code below for building index data:
 

    string streetLayerShapeFile = txtShpFile.Text;
            Collection<Feature> streetFeatures = null;
            ShapeFileFeatureLayer streetLayer = new ShapeFileFeatureLayer(streetLayerShapeFile); 

            Collection<DbfMatchingPluginColumn> columns = new Collection<DbfMatchingPluginColumn>();

            // Add necessary columns into the collection
            columns.Add(new DbfMatchingPluginColumn("ID_LINK", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.String, 10));
            columns.Add(new DbfMatchingPluginColumn("DT_NAME", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.String, 20));
            columns.Add(new DbfMatchingPluginColumn("BB_CX", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
            columns.Add(new DbfMatchingPluginColumn("BB_CY", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
            columns.Add(new DbfMatchingPluginColumn("BB_ULX", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
            columns.Add(new DbfMatchingPluginColumn("BB_ULY", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
            columns.Add(new DbfMatchingPluginColumn("BB_LRX", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
            columns.Add(new DbfMatchingPluginColumn("BB_LRY", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));

            // Create the MatchDbf object according to the path and the collection of DbfColumnDefinition
            DbfMatchingPlugin.CreateDbf(@"C:\Documents and Settings\administrator\Desktop\testShape.dbf", columns);
            DbfMatchingPlugin matchingPlugIn = new DbfMatchingPlugin(@"C:\Documents and Settings\administrator\Desktop\testShape.dbf", DbfMatchingPluginReadWriteMode.ReadWrite);

            streetLayer.Open();

            int count = streetLayer.FeatureSource.GetCount();

            String[] IDLink = new string[count];
            string[] stName = new string[count];
            Double[] BB_CX = new Double[count];
            Double[] BB_CY = new Double[count];
            Double[] BB_ULX = new Double[count];
            Double[] BB_ULY = new Double[count];
            Double[] BB_LRX = new Double[count];
            Double[] BB_LRY = new Double[count];

            List<string> sortList = new List<string>();

            for (int i = 0; i < count; i++)
            {
                Feature streetFeature = streetLayer.FeatureSource.GetFeatureById((i + 1).ToString(), ReturningColumnsType.AllColumns);
                IDLink[i] = streetFeature.ColumnValues["LINK_ID"];
                stName[i] = streetFeature.ColumnValues["ST_NAME"];
                BB_CX[i] = streetFeature.GetBoundingBox().GetCenterPoint().X;
                BB_CY[i] = streetFeature.GetBoundingBox().GetCenterPoint().Y;
                BB_ULX[i] = streetFeature.GetBoundingBox().UpperLeftPoint.X;
                BB_ULY[i] = streetFeature.GetBoundingBox().UpperLeftPoint.Y;
                BB_LRX[i] = streetFeature.GetBoundingBox().LowerRightPoint.X;
                BB_LRY[i] = streetFeature.GetBoundingBox().LowerRightPoint.Y;
                sortList.Add(string.Format("{0},{1},{2},{3},{4},{5},{6},{7}", IDLink[i], stName[i], BB_CX[i], 
                                        BB_CY[i], BB_ULX[i], BB_ULY[i], BB_LRX[i], BB_LRY[i]));
            }

            streetLayer.Close();

            // Open the index dbf file and add records.
            matchingPlugIn.Open();

            sortList.Sort(delegate(string lineA, string lineB)
            { return lineA.Split(',')[0].CompareTo(lineB.Split(',')[0]); });

            foreach(string record in sortList)
            {
                string[] parts = record.Split(',');
                string idLink = parts[0];
                string streetName = parts[1];
                int bb_Cx  = int.Parse((double.Parse(parts[2]) * coordinatesMultiplier).ToString());
                int bb_Cy = int.Parse((double.Parse(parts[3]) * coordinatesMultiplier).ToString());
                int bb_Ulx = int.Parse((double.Parse(parts[4]) * coordinatesMultiplier).ToString());
                int bb_Uly = int.Parse((double.Parse(parts[5]) * coordinatesMultiplier).ToString());
                int bb_Lrx = int.Parse((double.Parse(parts[6]) * coordinatesMultiplier).ToString());
                int bb_Lry = int.Parse((double.Parse(parts[7]) * coordinatesMultiplier).ToString());
                matchingPlugIn.AddRecord(new object[] { idLink, streetName, bb_Cx, bb_Cy, bb_Ulx, bb_Uly, bb_Lrx, bb_Lry});
            }

            matchingPlugIn.Close();

 

2, how can I use fuzzy Match. Do I need to create a custom dbfMatchingPlugin to do that? how can I enable the MatchMode.Fuzzy with it?
 
In your code, you used the Geocoder object, not the UsaGeocoder object, currently, we just created the soundex index file for USA, so in the currently code, we only can support the fuzzy match for UsaGeocoder object, if you want to use the fuzzy match for the other country, you should create an subclass inherited to the Geocoder object, the Geocoder class is the base class, you can create the custom Geocoder object for any countries such as the UsaGeocoder. 
 
3, if I want the result to return also the city, state, country names which a street belongs to.. (collection of results by fuzzy match).. Should I create the dbf index file for the city, province, country layers and add the CityMatchingPlugin etc to the Geocoder?
 
I think you shouldn’t create the dbf index file for the city, province, country layers; I have a suggestion to you for creating index dbf file:
 
Before you create your street index dbf file, you can prepare a database, then insert all field information what you want into the database, for example, you can create a table that names StreetData, the fields are streetname, city, state, county and so on. So when you create the index dbf file you can get all information from the table and add records to the dbf file one by one.

Thanks,



Thanks Scott. 



i found that



 matchResult = geocoder.Match(input);




requires input string to match exactly the values in column "ID_BLAH". Is that right?   I do the following and insert the street names to the ID_NAME column, so i can search by name.  



 columns.Add(new DbfMatchingPluginColumn("ID_NAME", ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.String, 30));




Aside from soundex, if I want to search for an address by a partial address (eg. search for "Main St" and input "main"), right now, it doesn't work.  It requires me to give the full address ("main st").  Do I need to override MatchCore if I want to search by a partial address?



and.. I don't seem to able able to retrieve the values in the "DT_BLAH" columns.. when it finds the match, in the match, I only see elements for the "DT_BLAH", boundingbox and the centroidpoint like in the screen shot


how can I use the values in the "DT_BLAH" column(s)?


 


Thanks!


Lishan



Lishan, 
  
 I see you encountered 2 questions when you executing the Match operation, I answered your questions below one by one: 
  
 For your first question: 
  
 1, Aside from soundex, if I want to search for an address by a partial address (eg. search for “Main St” and input “main”), right now, it doesn’t work.  It requires me to give the full address (“main st”).  Do I need to override MatchCore if I want to search by a partial address? 
  
 In fact, if you aside from soundex index file, you still want to search for an address by a partial address, you really need to override MatchCore method, you need to write your own logic to implement the searches for an partial address. In currently MapSuiteGeocoder version, we search the partial address according to the soundex index file and streets.dbf file,  so we can support the exact match and fuzzy match, if you don’t need the soundex index file, we only can support the exact match and you have to input the full address to search, not a partial address, in the core code, we will search the streets.dbf file by binary search function.  
  
 2, how can I use the values in the “DT_BLAH” column(s)? 
  
 When you get the collection of GeocoderMatch, you can use the following code to get the values in the “DT_BLAH” column: 
  
    string result = matchItem.NameValuePairs[“DT_BLAH”]; 
  
 If you have any other questions please let me know, 
  
 Thanks, 
  
 Scott,