I have the usa geo coder running now and would like to incorporate Canadian data. My understanding is that I have to purchase the raw data from either navteq or teleatlas. My question is how to convert the raw data to your .dbf format and feed it to the geocoder plug in.
Thanks
Geo Coder for Canada
Thanks for your posts.
Regarding to the integrating custom data into Geocoder, there is a pattern:
1. Create a Dbf file. There should a key column whose name starts with "ID_"(for example, it could be"ID_Street" representing street name), and there might be some additional columns whose names start with "DT_"(for example, they could be "DT_Zip" representing zip code). and there should be two columns representing coordinates whose name are "BB_CX"(means longitude) and "BB_CY"(means latitude). If possible, there might be four columns representing the bounding box for item whose name are "BB_ULX"(means upper left X of bounding box), "BB_ULY"(means upper left Y of bounding box), "BB_LRX"(means lower right X of bounding box), "BB_LRY"(means lower right Y of bounding box).
2. Sorting the raw data according to the key column you defined and insert into Dbf file. We use binary search for the key column to get the best performance in the Match method.
3. Create a custom PlugIn to use that data. you could check out our HowDoISample to get how to create and index file and create custome PlugIn.
Regards.
How about if I get your Map Suite World Map Kit . Do I have to create the dbf file myself, or the kit contains the dbf files.
Thanks
I am nor sure if I got you.
1. The Map Suite World Map Kit is an independent map data set.
2. The Geocoder index data is another data set only containing necessary data for Geocoder but not for map.
3. In our samples, we just reference a world map kit web service so that it can provide good UI experience for customer.
Any questions please let me know.
In the description of the Wolrd Map Kit product, it said the product "includes a complet set of GIS spatial data" for United States and Canada.
Can I use the data to create your dbf file
Thanks
Sainah,
Thanks for your post again, actually, you can build your own Geocoder index data from the WorldMapKit data, in the MapSuite Geocoder 3.0 samples, there is a sample that names BuldIndexFile, when you build your own index data please reference this sample.
If you need to create your own Geocoder index data, the steps are the following:
1, Need the data source such as the world map kit data or any other data source.
2, Create a DbfMatchingPlugin or inherit from the DbfMatchingPlugin class to write your own logic.
3, Open the created dbf file and write record into it.
If you still have any other problems please let me know,
Thanks,
The following files are found on the data directory:
citystate.dbf, county.dbf, numberlist.txt, rt2.dbf, rt2.ids, rt2.idx, SoundExCityState.dbf, State.dbf, streetname.ids, streename.idx, streets.dfb, StreetSoundEx.dbf, tlid.dbf, zip.dbf.
Is there any documentation on these files, and what files are absolutely needed for the reverse geocoder and the forward geocoder to work properly.
Sainah,
The data structure for each Geocoder plugin is the following:
Street Geocoder: numberlist.txt, rt2.dbf, rt2.idx, rt2.idx, streetname.idx, streetname.idx, streets.dbf, tlid.dbf.
City Geocoder: citystate.dbf.
County Geocoder: county.dbf,
City soundex Geocoder: SoundexExCityState.dbf.
Street soundex Geocoder: StreetSoundEx.dbf.
Zip Geocoder: zip.dbf,
State Geocoder: state.dbf,
Reverse Geocoder: rt2.idx, rt2.ids, rt2.dbf, tlid.dbf, zip.dbf, streets.dbf, zipBBX.txt.
Currently, we haven’t any documentations for these index data, maybe we will do it in the future.
Thanks,
Hi,
I’m reading the GeocodingForChicago sample codes. It looks to me that all the dbf files in ChicagoData folder are being used in the geocoding sample.
What kind of geocoder from the list mentioned in the last posting it’s using?
What does each of columns, ID_Sound and DT_SLdx in StreetSoundEx.dbf mean? Are they supposed to be information I can find from Navteq shapefiles?
When I create my dbf files from my Navteq shape files for my Europe data, am I supposed to mimic the exact format like those ones in the ChicagoData folder?
Thanks a lot,
Tracy
Tracy,
Thanks for your post, I answered your questions one by one below:
1, What kind of geocoder from the list mentioned in the last posting it’s using?
Actually, in the GeocodingForChicago sample, it mainly uses the StreetMatchingPlugin to match the street address, because we use the street address as the input parameters. Also in the UsaGeocoder object, default, it includes 9 plugins, they are:
StreetMatchingPlugin, ZipDbfMatchingPlugin, CityDbfMatchingPlugin, StateDbfMatchingPlugin, CoordingatesMatchingPlugin, CountyDbfMatchingPlugin, CensusTractsDbfMatchingPlugin, CensusBlockDbfMatchingPlugin, CensusBlockGroupDbfMatchingPlugin.
You can see the CensusBlockGroupDbfMatchingPlugin is the last matching.
2, What does each of columns, ID_Sound and DT_SLdx in StreetSoundEx.dbf mean? Are they supposed to be information I can find from Navteq shapefiles?
The StreetSoundEx.dbf is used to Fuzzy match, when we process the binary search in the StreetSoundex.dbf file, it will generate the soundex code first according to the input address, then we need to get the SoundexIdKey from this StreetSoundex.dbf file, the SoundexIdKey means the ID_Sound column name, it is the primary key in this dbf file and it uses to the binary search, when we searched a record from the StreetSoundex.dbf file, we will get the DT_SIds value to match the correct record in the streets.dbf file.
I think you can use the StreetSoundex.dbf file directly for your Navtep shape files, if your Navtep shape files are belong to the English contries.
3, When I create my dbf files from my Navteq shape files for my Europe data, am I supposed to mimic the exact format like those ones in the ChicagoData folder?
Yes, I suggest you to create your own index file mimic the format like our index files, also when create your own index file, I think you can add any useful information to your index file.
If you have any questions please let me know,
Thanks,
Scott,
Hi Scott,
How to generate an soundex.dbf for, e.g. provinces or cities in Canada?
Thanks,
Tracy
Tracy,
About your requirement, there are 4 steps on it, please follow the steps below:
1, You need to generate soundex value for each street name, you can use the following code: SimplifiedSoundex soundex = new SimplifiedSoundex(); string soundexValue = soundex.GenerateSoundex(streetName);
2, Then you can write the soudex value and position to a text file:
using (StreamWriter writer = new StreamWriter(Path.Combine(YourFilePath, SoundexStreet.txt)))
{
string soundexValue = soundex.GenerateSoundex(streetName);
writer.WriteLine(string.Format("{0}|{1}|{2}", soundexValue, 0, streetName));
writer.Close();
}
2, Create the soundex dbf index file:
Collection<dbfmatchingplugincolumn> streetsColumnList = new Collection<dbfmatchingplugincolumn>();
streetsColumnList.Add(new DbfMatchingPluginColumn(ThinkGeo.MapSuite.MapSuiteGeocoder.GeocoderHelper.idSoundExPrefixColumnName, ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.String, 25));
streetsColumnList.Add(new DbfMatchingPluginColumn(ThinkGeo.MapSuite.MapSuiteGeocoder.GeocoderHelper.dtSoundExIdxInStreetName, ThinkGeo.MapSuite.MapSuiteGeocoder.DbfMatchingPluginColumnType.Long, 4));
DbfMatchingPlugin.CreateDbf(Path.Combine(YourDataPath, StreetSoundEx.dbf), columns);
DbfMatchingPlugin soundexDbf = new DbfMatchingPlugin(Path.Combine(YourDataPath, StreetSoundEx.dbf), DbfMatchingPluginReadWriteMode.ReadWrite);
soundexDbf.Open();
// Get the data from the txt file.
StreamReader reader = new StreamReader(Path.Combine(YourFilePath, SoundexStreet.txt));
string line = string.Empty;
while ((line = reader.ReadLine()) != string.Empty)
{
string[] parts = line.Split('|');
soundexDbf.AddRecord(new object[] { parts[0], parts[1] });
}
soundexDbf.Close();
This is just a sample for building the soundex dbf file, but I think it is useful for you,
Thanks,
Scott,
Hi Scott,
Can I use the same way you provided to create soundex files for non English speaking countries.
Thanks,
Tracy
Tracy,
I’m sorry to tell you that you can’t use the same way to create the soundex files for non English speaking countries, because we created the soundex index file just by English Soundex algorithm, we just considered the English speaking countries, if you want to implement the soundex search for streets, you need to create your own soundex index dbf by the special language algorithm.
Thanks,
Scott,
Hi Scott,
Does it also mean that the soundex plug in will not work for non english speaking countries either and I’ll have to come up with a matching algorithm as well?
Thanks,
Tracy
Tracy,
Yes, as you said, the soundex plugin also can not work for non English speaking countries, in the soundex plugin we ust wrote the logic by the English soundex algorithm, you need to override your own class inherates the DbfMatchingPlugin and override the MatchCore function. I suggest you to research the soundex algorithm for your language first, I think the soundex algorithm can not support all language, because of the soundex algorithm is implement according to the pronunciation, currently I think it can support English, French, but I’m not sure whether it can support any other languages.
If you have any questions please let me know,
Thanks,
Scott,
hi
i want to search address for california using geocoder but how to get the following files of california county
Street Geocoder: numberlist.txt, rt2.dbf, rt2.idx, rt2.idx, streetname.idx, streetname.idx, streets.dbf, tlid.dbf.
City Geocoder: citystate.dbf.
County Geocoder: county.dbf,
City soundex Geocoder: SoundexExCityState.dbf.
Street soundex Geocoder: StreetSoundEx.dbf.
Zip Geocoder: zip.dbf,
State Geocoder: state.dbf,
plz help its urgent
vivek
Vivek,
Welcome to join the MapSuite discussion forum.
That data are included into full version of Geocoder package, if you want it you can contact with our support@thinkgeo.com to request it.
Thanks,
James