Table TB_AddressGeocodeCache

Card of table TB_AddressGeocodeCache

Name

TB_AddressGeocodeCache

Dimensional Type

<None>

Comment

This utility table stores address -> longitude/latitude mappings for addresses. Stores also a hash for the address. The addresses that are stored are the original, unclean addresses used to generate the hash. Lookups may be done based on the address, but since none of them are currently indexed, this could be slow. The hash is better.

Because different databases potentially compute hashes differently, this table has both a TB_Hash and TB_HashType field. Both together are the primary key. If the hash alone were the primary key, we couldn't use different types of hashes.

If one is using SQL Server, it is recommended that the following function (defined in this model) be used to compute the hash: F_CalculateAddressSHA1XSumVarChr. The hash type should be set to 'SQL Server HashBytes SHA1'.

See also the ETL code that populates this table, which defines some appropriate hash-calculating functions for use with SQL Server (the SSIS ETL package is TBGeoCache.dtsx).

Finally, see documentation on VW_AddressGeoCodeCache, which describes various approaches for using the data here.

SQL Server functions useful for calculating checksums for use in maintaining this table are also included in this model, but the function definitions must be uploaded to the SQL Server instance you are fetching address data from, and permission must be granted to execute them, as in:

grant execute on dbo.F_CALCULATEADDRESSSHA1XSUMVARCHR to [ADS\<groupname>];
grant execute on dbo.F_CALCULATEADDRESSSHA1XSUM to [ADS\<groupname>];


Check constraint name of the table TB_AddressGeocodeCache

CKT_TB_ADDRESSGEOCODECACHE


List of diagrams containing the table TB_AddressGeocodeCache

Name

UtilityTablesDiagram


List of columns of the table TB_AddressGeocodeCache

Name

Comment

Domain

Data Type

Length

TB_Addr_Hash

Typically contains a hex hash of a given raw (potentially dirty) address in a transactional system. Typically it's going to be a SHA1 hash generated by calling F_CalculateAddressSHA1XSumVarChr (a function defined in the data warehouse, as well as in any SQL Server instance that will be using this table as part of an ETL package or program).

<None>

varchar(128)

128

TB_Addr_HashType

Name of application that produced TB_AddrHash (e.g., Yahoo! PlaceFinder). A version number may, if needed, be tacked onto the end.

<None>

varchar(32)

32

TB_Addr_Line1

 

<None>

nvarchar(128)

128

TB_Addr_Line2

 

<None>

nvarchar(128)

128

TB_Addr_Line3

 

<None>

nvarchar(128)

128

TB_Addr_CityStateZip

 

<None>

nvarchar(128)

128

TB_Addr_Country

 

<None>

nvarchar(128)

128

TB_Addr_Longitude

 

<None>

float

 

TB_Addr_Latitude

 

<None>

float

 

TB_Addr_KilometersFromCampus

Great circle distance, in kilometers, from the center of Carleton College's Northfield campus.

<None>

float

 

TB_Addr_Quality

 

<None>

float

 

TB_Addr_GeoProvider

Name of vendor that provided latitude, longitude, and quality figures for a given address. Should be something simple like "Yahoo! PlaceFinder" or "Google Apps," possibly (if useful) with an API version number appended.

<None>

nvarchar(32)

32

TB_Addr_LastUpdate

 

<None>

datetime

 

TB_Addr_LastSeen

 

<None>

datetime

 


List of indexes of the table TB_AddressGeocodeCache

Name

Unique

Cluster

Primary

Foreign Key

Alternate Key

Table

TB_ADDRESSGEOCODECACHE_PK

TRUE

TRUE

TRUE

FALSE

FALSE

TB_AddressGeocodeCache

TB_ADDR_CITYSTATEZIP_IDX

FALSE

FALSE

FALSE

FALSE

FALSE

TB_AddressGeocodeCache


List of keys of the table TB_AddressGeocodeCache

Name

Identifier_1