This scenario shows you how to geocode a latitude and longitude value for Canada addresses.
1. Assume you have Canada address stored in a text file delimiated by '|'. Such as:
- 1|CA|A0A|NL||1 NEW RD
- 2|CA|A0A|NL||17 NEW RD
- 3|CA|A0A|NL||72 NEW RD
2. Ensure that following file is present in your geocoder reference data path
Create a new Project, Batch Job, and Dataflow
1. From the Projects menu, select New>Project.
2. Name the project Geo_Training and click Create.
3. Right-click the Geo_Training project and select New Batch Job.
4. Name the batch job addr_geo and press Enter.
5. Make sure the addr_geo job tab is highlighted, click the Data Flow icon at the right side bar, and click it again on the canvas (design area). Name the dataflow addr_to_geo.
Create a New Input File
1. In the Local Objects Library pane in the lower left of the screen, choose the Formats tab.
2. Right-click Flat File and select New.
3. Define the File Format by making the changes below.
- Name: addr_to_geo
- Root Directory: D:\DKT_Files\Geocoder (or click the icon besides it to navigate to it and select)
- File Name: addr_geo _input.txt (or click the icon besides it to navigate to it and select)
- Column: | (click Shift+\ to enter character “|”)
- Skip row header: Yes
Note: If a warning dialog asks whether to overwrite the current schema, click Yes.
Note: If you see the file content display at the right part of the window, it indicates you make the right changes.
4. Change the Fields Attributes for all fields listed on the right side:
- Data Type: varchar
- Field Size: 100
Verify that the Content Type map is the same as shown below.
5. Click the Save and Close button to return to the main Data Services window.
Add Input File to Dataflow as Source
1. Double-click on the addr_to_geo file format and drag it to the dataflow canvas.
2. Select Make Source.
Note: you can click the “zoom” icon to view the input data in the lower panel.
Add the Global Address Cleanse Transform
1. Choose the Transform tab.
2. Expand the Data Quality node.
3. Expand the Global Address Cleanse node.
4. Select Global_AddressCleanse and drag it to the dataflow canvas.
5. Name it addr_cleanse.
6. Link the “addr_geo_input.txt” file format to the addr_cleanse transform.
7. Double-click the addr_ cleanse transform to open the Options Setup window.
8. On the Input tab, map Postcode to Postcode by selecting POSTCODE from the Input Schema column on the POSTCODE row.
9. Select the In use radio to make sure that you get the input map shown below.
10. Choose the Output tab.
11. Select the Best practice radio button.
12. Select the check boxes for the following fields: COUNTRY_NAME, LOCALITY1_NAME, POSTCODE1, POSTCODE2, PRIMARY_NUMBER, PRIMARY_NAME1, PRIMARY_TYPE1, and REGION1.
13. Select the In use radio button to make sure you get the output below.
Add GEO Transform
1. Return to the previous view by clicking on the Back button (green arrow), or double-clicking the addr_to_geo dataflow.
2. Choose the Transform tab.
3. Expand the Geocoder node.
4. Select the Geocode transform and drag it to the dataflow canvas.
5. Rename the transform addr_to_geo.
6. Link the addr_cleanse transform to the addr_to_geo transform.
7. Double-click the addr_to_geo transform to open the Options Setup window.
8. On the Input tab, select the In Use radio box to make sure you get the input map shown below. If not, select the All radio box and correct the missing input fields mapping.
Note: In this scenario, you don’t need to change anything on the Options tab page.
9. Choose the Output tab.
10. Select the Best practise radio button.
11. Select the check boxes for the four fields shown below.
Define the Output File Format
1. Choose the Formats tab.
2. Right-click Flat Files and select New.
3. In the left panel of the File Format Editor window, make the following changes:
4. In the right panel, manually add four fields, as shown below:
5. Click the Save & Close button.
Add the Output File Format
1. Choose the addr_to_geo Data Flow tab in the right panel.
2. Select the addr_to_geo_output file format and drag it to the dataflow canvas.
3. Select Make Target.
4. Rename it addr_to_geo_output_file.
5. Link the addr_to_geo transform to addr_to_geo_output_file.
6. Double-click the addr_to_geo_output_file to open the Options Setup window.
7. On the left panel, make the following changes:
Root directory: D:\DKT_Files\Geocoder\results
File name: addr_to_geo_result.txt
8. Select Project > Save All to save your work.
Execute the Job
1. Right-click the addr_geo job and select Execute.
2. At the popup window, click OK.
3. Once the job has completed successfully, select the data flow.
4. View the data by clicking on the magnifying glass icon (highlighted). You may need to press F5 to refresh the screen. The Assign_Level tells how accurate the address matches/”be assigned” the geocode. If there is any issue, the Info_Code gives the information about what is that issue.