Principle and design of SHP data batch importing PostgreSQL tool

Source: Internet
Author: User
Tags postgresql
1. Background

In the production of the overall open source toolbox products, data warehousing is an important link. Although PostGIS provides data warehousing interface operations, this tool cannot be integrated into our toolbox, and the tool interface, operation is not ideal, and can not be customized to complete a number of specific requirements. Therefore, it is more necessary to make a self-made SHP storage tool.

2. Thinking 2.1 shp Import idea

SHP import into the database, whether it is PostgreSQL, MySQL, Oracle, etc., is the first to convert SHP to match the corresponding database of SQL, and then import into the corresponding database.

For PostgreSQL, the Pgsql2shp.exe tool in the PG installation path enables the conversion of SHP data into compliant SQL.

2.2 Batch Import Ideas

We can use the Write BAT file to import each SQL generated by the transformation in turn.

2.3 Precautions

Problems with missing spatial information tables and spatial functions may occur in a.postgresql, resulting in data not being imported. For this kind of problem, we can check the related table and function before importing, and then make the whole batch import.

B.SHP and shp where the file path needs to be in English.

3. Flowchart Design

4. Implement

--Welcome reprint, but retain the copyright, please indicate the source in obvious place: http://www.cnblogs.com/naaoveGIS/

Principle and design of SHP data batch importing PostgreSQL tool

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.