Setting up a geocoder to run automatically
You can set up a geocoder to automatically translate data as soon as the data is added to, or updated in, a table.
Before you begin
Before you can set up a geocoder to run automatically:
- You must set up geocoding operations for each spatial column that is to be populated by output from the geocoder.
- Your user ID must hold the following authorities
or privileges:
- DBADM and DATAACCESS authority on the database that contains the table on which triggers to invoke the geocoder will be defined
- CONTROL privilege
- ALTER, SELECT, and UPDATE privileges.
- The privileges required to create triggers on this table.
About this task
You can set up a geocoder to run automatically before you invoke it in batch mode. Therefore, it is possible for automatic geocoding to precede batch geocoding. If that happens, the batch geocoding is likely to involve processing the same data that was processed automatically. This redundancy will not result in duplicate data, because when spatial data is produced twice, the second yield of data overrides the first. However, it can degrade performance.
Before you decide whether
to geocode the address data within a table in batch mode or automatic
mode, consider that:
- Performance is better in batch geocoding than in automatic geocoding. A batch session opens with one initialization and ends with one cleanup. In automatic geocoding, each data item is geocoded in a single operation that begins with initialization and concludes with cleanup.
- On the whole, a spatial column populated by means of automatic geocoding is likely to be more up to date than a spatial column populated by means of batch geocoding. After a batch session, address data can accumulate and remain ungeocoded until the next session. But if automatic geocoding is already enabled, address data is geocoded as soon as it is stored in the database.
Procedure
To set up a geocoder to run automatically:
Choose which method to use to set up automatic geocoding:
- Issue the db2se enable_autogc command.
- Run an application that calls the DB2GSE.ST_ENABLE_AUTOGEOCODING procedure.