ThinkGeo.com    |     Blog    |     Wiki    |     Support

Limit number of returned matches or just take the first one?

I am wondering if it is possible to tell GeoCoder to either simply return the first match found, or limit the number of matches returned?

The basic task is just zip code lookup for a city and state, but in doing so, it seems to be returning every address for that city and state, which takes a long time. If I can limit it to just the first match, it seems like that would be quicker.

I did come across this DbfManager thread, which is failing because the OLEDB provider is not registered. If there’s a way to do this with GeoCoder directly, that would be simpler for me.

Hi Jay,

I checked the source code and not found there is a way to limit the number of matches returned, but we can set the plugins to limit the number of the matches returned. Just add the necessary plugins into the MatchingPlugIns property of Geocoder.

• AddressPointMatchingPlugin
• CensusBlockDbfMatchingPlugin
• CensusBlockGroupDbMatchingPlugin
• CensusTractsDbfMatchingPlugin
• CitryDbfMatchingPlugin
• CoordinatesMatchingPlugin
• CountyDbfMatchingPlugin
• CustomStreetMatchingPlugin
• DbfMatchingPlugin
• IpAddressMatchingPlugin
• PostCodeMatchingPlugin
• SoundexDbfMatchingPlugin
• StateDbfMatchingPlugin
• StreetMatchingPlugin
• StreetSQLServerMatchingPlugin
• ZipDbfMatchingPlugin

The “DbfMatchingPlugin” allow us to access the “.dbf” file directly. Please view our wiki http://wiki.thinkgeo.com/wiki/thinkgeo.mapsuite.mapsuitegeocoder.matchingplugin to learn more.

I guess the issue “OLEDB provider is not registered” should be related with the Microsoft Access version and driver, and please view http://www.connectionstrings.com/access/ to learn more information about the OLEDB connection.

Hope it’s helped for you.

Thanks,
Peter

Thanks, Peter. I was able to get the proper drive installed so I could use the DbfManager, which seems like it would probably be the quickest. I will check out the plugin approach as well, just to verify.

Hi Jay,

Very glad to hear the “DbfManager” can work for you. Any questions please feel free to let us know.

Thanks,
Peter