PostGIS Import and export shp considerations

Source: Internet
Author: User

1, the PostgreSQL database indicates the use of lowercase, the table name can not use uppercase, otherwise it will not be recognized.

2. Before data import, you need to add space extension function to the database you need to import.

3, when using PostGIS shapfile and DB loader plug-in, the selected SHP file path cannot have Chinese, the path can not be too complicated. Otherwise, the DBF file (. dbf) can is not opened error.

4, import the default encoding is UTF-8, need to change to GBK, otherwise will error.

5, according to the above steps, the basic can be imported successfully.

6. The successful import of SHP file name will automatically become a lowercase name, and use the table name. As shown, the result of the data import.

Export of SHP

The export of SHP is actually using the Bin\pgsql2shp.exe

1, attention to coding problems, because the exported options have no encoding option to choose Settings.

Try 1): Enter Psql console to modify the client character set, the results are invalid, set to GBK after the SHP attribute table is still garbled in Chinese

--Modify the client character set
postgres=# show client_encoding;
Client_encoding UTF8
(1 row)

postgres=# set client_encoding= ' GBK ';
SET

Try 2): Set the system environment variable PGCLIENTENCODING=GBK, exit PostgreSQL re-login, execute successfully!.

Note: Coding issues, because the exported options do not have an encoding option available for setup.

Then the export operation is performed and the export prompt succeeds.

Use ArcMap to open the data for viewing.

The exported data does not have a. prj file, and it needs to be set up with Arccatalog.

The article also mentions the use of the command line import and export method, for the time being no attempt, the future needs to be studied.

Contact: qq--56524046 e-mail: [Email protected]

To undertake GIS outsourcing, GIS data processing and other services.

Provide GIS solutions, technical guidance and so on.

PostGIS Import and export shp considerations

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.