- Mastering PostGIS
- Dominik Mikiewicz Michal Mackiewicz Tomasz Nycz
- 297字
- 2021-07-02 22:52:20
Importing data using pgAdmin
In this section we'll import some new data we have not interacted with before - this time we'll have a look at the Ordnance Survey's address data we obtained in the CSV format.
For the examples involving pgAdmin, screenshots were taken using pgAdmin III (1.22.2).
PgAdmin's import functionality is basically a wrapper around the \COPY so it does require a data model in order to work. Because of that, let's quickly create a table that will be populated with the imported data. You can do it with the GUI by simply right-clicking a schema node you want to create the table in and choosing New Object | New Table and then providing all the necessary model definitions in the displayed window:

You can also type some SQL which in many cases is a bit quicker:
drop table if exists data_import.osgb_addresses;
create table data_import.osgb_addresses(
uprn bigint,
os_address_toid varchar,
udprn integer,
organisation_name varchar,
department_name varchar,
po_box varchar,
sub_building_name varchar,
building_name varchar,
building_number varchar,
dependent_thoroughfare varchar,
thoroughfare varchar,
post_town varchar,
dbl_dependent_locality varchar,
dependent_locality varchar,
postcode varchar,
postcode_type varchar,
x numeric,
y numeric,
lat numeric,
lon numeric,
rpc numeric,
country varchar,
change_type varchar,
la_start_date date,
rm_start_date date,
last_update_date date,
class varchar
);
Once our table is ready, importing data is just a matter of right clicking the table node in PgAdmin and choosing Import. An import wizard that assists with the import process will be displayed:

- 基于C語(yǔ)言的程序設(shè)計(jì)
- 程序設(shè)計(jì)缺陷分析與實(shí)踐
- 分布式多媒體計(jì)算機(jī)系統(tǒng)
- 統(tǒng)計(jì)策略搜索強(qiáng)化學(xué)習(xí)方法及應(yīng)用
- Arduino &樂(lè)高創(chuàng)意機(jī)器人制作教程
- Enterprise PowerShell Scripting Bootcamp
- Machine Learning with Apache Spark Quick Start Guide
- OpenStack Cloud Computing Cookbook
- Linux系統(tǒng)下C程序開發(fā)詳解
- 基于RPA技術(shù)財(cái)務(wù)機(jī)器人的應(yīng)用與研究
- Hands-On Business Intelligence with Qlik Sense
- 大數(shù)據(jù)素質(zhì)讀本
- 工程地質(zhì)地學(xué)信息遙感自動(dòng)提取技術(shù)
- 深度學(xué)習(xí)之模型優(yōu)化:核心算法與案例實(shí)踐
- 仿龜機(jī)器人的設(shè)計(jì)與制作