24
Address Fabric Data Getting Started Guide Version 2020.06.0

Address Fabric Data€¦ · MethodImport 2- CSV file into table using pgAdmin III. 1. Use pgAdmin GUI tool to import CSV file into a table in PostgreSQL. 2. Right click on the table

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

  • Address Fabric Data

    Getting Started Guide

    Version 2020.06.0

  • Table of Contents

    1 - Introduction

    Preface..................................................................4

    2 - Getting Started

    Loading Address Fabric Data in PostgreSQL.......6 Loading Address Fabric Data in Oracle................7 Loading Address Fabric Data in SQL..................10 Opening Address Fabric Data in MapInfo Pro®...11 Opening Address Fabric Data in QGIS...............14

    3 - Notices and Product Support

    Notices................................................................22 Product Feedback and Support...........................23

  • 1 - Introduction

    In this section

    Preface.......................................................................................................4

  • Introduction

    Preface

    This guide offers some hints and tips for getting started with Precisely Address Fabric Data for Canada and the US.

    Due to the size of the Address Fabric dataset, it is recommended to follow the configuration mentioned in the Data Specification section for the software that is being used.

    Address Fabric Data 2020.06.0 Getting Started Guide 4

  • 2 - Getting Started

    In this section

    Loading Address Fabric Data in PostgreSQL............................................6 Loading Address Fabric Data in Oracle.....................................................7 Loading Address Fabric Data in SQL.......................................................10 Opening Address Fabric Data in MapInfo Pro®.......................................11 Opening Address Fabric Data in QGIS....................................................14

  • Getting Started

    Loading Address Fabric Data in PostgreSQL

    To load Address Fabric data into PostgreSQL you'll need a machine running PostgreSQL version 9.2 or later.

    If you download and install PostgreSQL as part of this process, you'll be prompted to install additional items at the end of the installation process. Select Yes, then choose PostGIS Extension to create a spatial database.

    When the installation process is finished, create a SQL table using one of the two methods described below.

    Method 1- Use the create table Script

    For United States Address Fabric

    1. Create the table structure in the database. A template create table script can be found here. Make sure to change the table name in the template to the country you wish to load.

    2. Once the table structure is created, you can copy the data using PostgreSQL Copy command.

    copy from delimiter ‘\t’ csv header; copy US_AddressFabric from 'F:\US_Address_Fabric\ us_address_fabric_san_francisco.txt' delimiter ' ' csv header;

    • |table_name| - Name of created table using the create table script • |Path to file| - Path to file location • delimiter – Defines the delimiter (for United States Address Fabric the delimiter is tab) • csv header – Ignores the first line since it contains headers

    For Change Log

    1. Create the table structure in the database. A template create table script can be found here. Make sure to change the table name in the template to the country you wish to load.

    2. Once the table structure is created, you can copy the data using PostgreSQL Copy command.

    copy from delimiter ‘\t’ csv header; copy US_AddressFabric_ChangeLog from 'F:\US_Address_Fabric\us_address_fabric_san_francisco.txt' delimiter ' ' csv header;

    • |table_name| - Name of created table using the create table script • |Path to file| - Path to file location • delimiter – Defines the delimiter (for Change Log data the delimiter is tab) • csv header – Ignores the first line since it contains headers

    For Canada Address Fabric Data

    Address Fabric Data 2020.06.0 Getting Started Guide 6

    https://datadocumentation.s3.amazonaws.com/Addressing_and_Enrichment/Getting_Started_Scripts/Postgres/usa_address_fabric.sqlhttps://datadocumentation.s3.amazonaws.com/Addressing_and_Enrichment/Getting_Started_Scripts/Postgres/usa_address_fabric_change_log.sql

  • Getting Started

    1. Create the table structure in the database. A template create table script can be found here. Make sure to change the table name in the template to the country you wish to load.

    2. Once the table structure is created, you can copy the data using PostgreSQL Copy command. E.g.copy from delimiter ‘ ’ csv header; copy can_address_fabric from 'F:\Canada_Address_Fabric\canada_address_fabric_toronto.txt' delimiter ' ' csv header;

    • |table_name| - Name of created table using the create table script • |Path to file| - Path to file location • delimiter – Defines the delimiter (for Canada Address Fabric the delimiter is tab) • csv header – Ignores the first line since it contains headers

    Method 2- Import CSV file into table using pgAdmin III.

    1. Use pgAdmin GUI tool to import CSV file into a table in PostgreSQL. 2. Right click on the table and select import. 3. Browse to the file, select TXT as the format and click the Columns tab. 4. Select the columns to be imported. 5. When the import process finishes, click the Done button.

    Loading Address Fabric Data in Oracle

    This section provides instructions for importing data into Oracle using the SQL scripts.

    Prerequisites

    You will need the following tools and scripts to load the Address Fabric data into an Oracle™ database:

    • A computer with the Oracle client installed • SQL Loader (packaged with the Oracle client) • Create table script • Oracle CTL template file • Index and spatial script files

    Loading US Address Fabric Data Using the SQL Script

    1. Create the table structure in the database. A template for the create table script can be found here. Make sure to change the table name in the template to the country you wish to load.

    2. Once the table structure is created you will need to take a copy of the Oracle CTL template US_Address_Fabric_CTL_Template.ctl and add it to the same directory as your Address

    Address Fabric Data 2020.06.0 Getting Started Guide 7

    https://datadocumentation.s3.amazonaws.com/Addressing_and_Enrichment/Getting_Started_Scripts/Postgres/can_address_fabric.sqlhttps://datadocumentation.s3.amazonaws.com/Addressing_and_Enrichment/Getting_Started_Scripts/Oracle/usa_address_fabric.sqlhttps://datadocumentation.s3.amazonaws.com/Addressing_and_Enrichment/Getting_Started_Scripts/Oracle/USA_Address_Fabric_CTL_Template.ctl

  • Getting Started

    Fabric data file. Open the CTL file in a text editor and add in the name of the Address Fabric TXT file and Oracle destination table.

    • Name of the Address Fabric text file • Name of the Oracle destination table

    3. Launch a Windows command prompt (right-click the Start menu icon, type cmd and press ). Enter user details for the SQL Loader script:

    sqlldr userid =

    @ control= log=

    After running this command, you should start to see data loading.

    Figure 1:

    Loading Change Log Data Using the SQL Script

    1. Create the table structure in the database. A template create table script can be found here. Make sure to change the table name in the template to the country you wish to load.

    2. Once the table structure is created you will need to take a copy of the Oracle CTL template US_Address_Fabric_ORACLE_CTL_TEMPLATE.CTL and add it to the same directory as your Address Fabric data file. Open the CTL file in a text editor and add in the name of the Address Fabric TXT file and Oracle destination table.

    • Open a Windows command prompt by right-clicking the Start menu icon, typing cmd and pressing . Enter user details in the SQL loader script as shown below:

    sqlldr userid =

    @ control= log=

    Address Fabric Data 2020.06.0 Getting Started Guide 8

    https://datadocumentation.s3.amazonaws.com/Addressing_and_Enrichment/Getting_Started_Scripts/Oracle/US_Load_data_script.txthttps://datadocumentation.s3.amazonaws.com/Addressing_and_Enrichment/Getting_Started_Scripts/Oracle/change_log_create_table.sqlhttps://datadocumentation.s3.amazonaws.com/Addressing_and_Enrichment/Getting_Started_Scripts/Oracle/USA_change_log_CTL_Template.ctlhttps://datadocumentation.s3.amazonaws.com/Addressing_and_Enrichment/Getting_Started_Scripts/Oracle/US_change_log_Load_data_script.txt

  • Getting Started

    After running this you should see the data loading into the database.

    Figure 2:

    Loading Canada Address Fabric Data Using the SQL Script

    1. Create the table structure in the database. A template create table script can be found here. Make sure to change the table name in the template for the country you wish to load.

    • Once the table structure is created you will need to take a copy of the Oracle CTL template Canada_Address_Fabric_ORACLE_CTL_TEMPLATE.CTL and add it to the same directory as your Address Fabric data file. Open the CTL file in a text editor and add in the name of the Address Fabric .txt file and Oracle destination table.

    • Open a Windows command prompt by right-clicking the Start menu icon, typing cmd and pressing . Enter user details in the SQL loader script as shown below:

    sqlldr userid=/

    @ control= log=

    • After running this you should see the data loading into the database.

    Figure 3:

    Address Fabric Data 2020.06.0 Getting Started Guide 9

    https://datadocumentation.s3.amazonaws.com/Addressing_and_Enrichment/Getting_Started_Scripts/Oracle/can_address_fabric.sqlhttps://datadocumentation.s3.amazonaws.com/Addressing_and_Enrichment/Getting_Started_Scripts/Oracle/Canada_Address_Fabric_CTL_Template.ctlhttps://datadocumentation.s3.amazonaws.com/Addressing_and_Enrichment/Getting_Started_Scripts/Oracle/Can_Load_data_script.txt

  • Getting Started

    Loading Address Fabric Data in SQL

    To successfully load the Canada, United States Address Fabric data, or Change Log data in theSQL server use the below mentioned create table and bulk insert commands for different datasets.

    Create the table structure in the database.

    Create table script for Canada Address Fabric can be found here

    Create table script for United States Address Fabric can be found here Create table script for United States Address Fabric Change Log data can be found here Bulk Insert command Once the table is created use the below mentioned bulk insert utility to import the data:

    BULK INSERT

    FROM < 'path\to\text\file\text_file_name.txt'>

    WITH

    (

    FIRSTROW = 2,

    FIELDTERMINATOR = '\t',

    ROWTERMINATOR = '0x0a'

    )

    GO

    Address Fabric Data 2020.06.0 Getting Started Guide 10

    https://datadocumentation.s3.amazonaws.com/Addressing_and_Enrichment/Getting_Started_Scripts/Sql/can_address_fabric.sqlhttps://datadocumentation.s3.amazonaws.com/Addressing_and_Enrichment/Getting_Started_Scripts/Sql/usa_address_fabric.sqlhttps://datadocumentation.s3.amazonaws.com/Addressing_and_Enrichment/Getting_Started_Scripts/Sql/usa_address_fabric_change_log.sql

  • Getting Started

    Opening Address Fabric Data in MapInfo Pro®

    StreetPro Traffic is available in TAB format for use in MapInfo Pro®.

    Loading Address Fabric in MapInfo Pro®

    Address Fabric data can only be used with MapInfo Pro® version 15.0 or higher.

    To load Address Fabric in MapInfo Pro®:

    1. Launch MapInfo Professional. 2. Navigate to the Home tab and, in the Open menu, click Table:

    3. In the Open window, set File Type to Delimited ASCII (*.txt). Select the data file and click Open. 4. In the Delimited ASCII Information dialog, set the value of File Character Set to Unicode

    UTF-8. Check the Use First Line for Column Titles option and click OK.

    Address Fabric Data 2020.06.0 Getting Started Guide 11

  • Getting Started

    Note: There is no need to change the delimiter type – the Tab option is selected by default.

    5. Data can now be viewed in the browser window. 6. Click the Spatial tab and select Create Points. 7. Set the following options in the Create Points dialog:

    Create Points Option Value

    Create Point for Table Table name

    Using Symbol Select point icon

    Projection Longitude/Latitude (WGS 84)

    Get X Coordinates from Column Longitude

    Get Y Coordinates from Column Latitude

    8. Click OK. 9. The Status window will display task progress and close automatically once the process completes. 10. Click the Map option in the Map tab to open the map layer in the browser and see points that

    were created.

    More tutorial and references on MapInfo Pro®:

    http://www.pitneybowes.com/us/location-intelligence/geographic-information-systems/mapinfo-pro.html

    https://www.youtube.com/user/mapinfo

    https://www.youtube.com/watch?v=tovr-g1FHNE

    https://www.youtube.com/watch?v=_FMDRcdu2Xo

    Address Fabric Data 2020.06.0 Getting Started Guide 12

    http://www.pitneybowes.com/us/location-intelligence/geographic-information-systems/mapinfo-pro.htmlhttps://www.youtube.com/user/mapinfohttps://www.youtube.com/watch?v=tovr-g1FHNEhttps://www.youtube.com/watch?v=_FMDRcdu2Xo

  • Getting Started

    Opening Files Larger than 2GB MapInfo Pro®

    To open a dataset larger than 2GB in MapInfo Pro®:

    1. Navigate to the Pro tab. 2. Select System Setting from the Option menu. 3. In the New Tables dialog, select MapInfo Extended from the Format drop-down. 4. Follow the steps outlined in the previous section.

    Address Fabric Data 2020.06.0 Getting Started Guide 13

  • Getting Started

    Opening Address Fabric Data in QGIS

    Opening Address Fabric Data in QGIS®

    This section describes how to open a flat file in QGIS.

    1. On the QGIS home page, click the Open Data Source Manager icon, located on the menu bar:

    2. The Data Source Manager | Browser window will open:

    3. Select the Delimited Text option in the Browser panel, as shown below:

    Address Fabric Data 2020.06.0 Getting Started Guide 14

  • Getting Started

    4. Click the Browse button and select the data file. The file and layer names will be displayed in the appropriate fields:

    Address Fabric Data 2020.06.0 Getting Started Guide 15

  • Getting Started

    5. Check Custom Delimiters in the File Format section, then check Tab:

    Address Fabric Data 2020.06.0 Getting Started Guide 16

  • Getting Started

    6. In the Record section, check the First record has field names option:

    Address Fabric Data 2020.06.0 Getting Started Guide 17

  • Getting Started

    7. Accept the default values in the Geometry Definition section. 8. Select Use spatial index option in the Layer Settings section:

    Address Fabric Data 2020.06.0 Getting Started Guide 18

  • Getting Started

    9. Click Add.

    Spatial data will be displayed in the QGIS window. The Layers panel will show the name of the selected file. Data is spatialized using latitude and longitude geometry.

    Address Fabric Data 2020.06.0 Getting Started Guide 19

  • Getting Started

    To adjust the layer’s style, click Menu > Settings > Style Manager.

    Address Fabric Data 2020.06.0 Getting Started Guide 20

  • 3 - Notices and Product Support

    In this section

    Notices......................................................................................................22 Product Feedback and Support................................................................23

  • Notices and Product Support

    Notices

    MapInfo® Pro is a registered trademark of Precisely

    The following are trademarks or registered trademarks of their respective holders:

    Oracle® is a registered trademark of Oracle Corporation.

    PostgreSQL is a registered trademark of the PostgreSQL Community Association of Canada.

    QGIS is a trademark of the Open Source Geospatial Foundation (http://qgis.osgeo.org).

    SQL Server and Windows are trademarks of Microsoft Corp.

    Address Fabric Data 2020.06.0 Getting Started Guide 22

    http://qgis.osgeo.org

  • Notices and Product Support

    Product Feedback and Support

    Contact our Support team for product support and additional product information. You can also submit your innovative ideas or comment on existing submissions in a way that is visible to all participants. Our Support site also includes information about our complete portfolio of Data products.

    Address Fabric Data 2020.06.0 Getting Started Guide 23

    http://support.precisely.com/

  • precisely

    2 Blue Hill Plaza, #1563 Pearl River, NY 10965 USA

    www.precisely.com

    © 2016, 2020 Precisely. All rights reserved.

    http:www.precisely.com

    Table of ContentsIntroductionPreface

    Getting StartedLoading Address Fabric Data in PostgreSQLLoading Address Fabric Data in OracleLoading Address Fabric Data in SQLOpening Address Fabric Data in MapInfo Pro®Opening Address Fabric Data in QGIS

    Notices and Product SupportNoticesProduct Feedback and Support