PostGIS user guide

PostGIS is an extension of PostgreSQL relational database for spatial operations. It provides PostgreSQL with the ability to store, query, and modify spatial relationships.

PostgreSQL is an open source Spatial Data library, and the spatial object extension module PostGIS built on it makes it a truly large Spatial Data library. SuperMap adds SDX + for PostGIS engine, which can directly access the PostgreSQL Spatial Data database and make full use of the ability of Spatial Info to serve the database. Such as spatial objects, Spatial Index, spatial manipulation functions, and spatial operators, to manage and access Spatial Data efficiently.

PostGIS will be described in the following aspects:

Deploying the PostGIS Spatial Data Library Environment

The Creation of PostGIS Database

SDX+ for PostGIS

Creation of PostGIS Data source.

PostGIS Spatial Data Editing

PostGIS Spatial Data display

Deploying the PostGIS Spatial Data Library Environment

It includes two parts: installation and configuration of PostgreSQL database and installation and configuration of PostGIS.

  • Step 1: Install and configure the PostgreSQL database. For detailed steps on installing PostgreSQL, see Install PostgreSQL . After

    installing PostgresSQL, find the PG _ hba. Conf file under the database Data Save directory (D: \ Program Files \ PostgreSQL \ 9.6 \ data), and add the content selected in the box in the location as shown in the following figure. Make PostgreSQL database services accessible via IP Address.

    Figure: Changing the PostgreSQL Config File.
  • Step 2: Install and configure PostGIS
    Caution:
    The version

    of PostGIS should be consistent with the version of PostgreSQL, otherwise the iDesktopX desktop may not be created or Open a database datasource.

    after successful installation.
    1. Start the installer: postgis-bundle-pg96x64-setup-2.4.2-1.exe.
    2. Here, you can choose to create a Spatial Data database. After the installation is completed, you can create the database according to the wizard dialog box. You can also create the database through the pgAdmin tool after the installation is completed.
    3. Specify the installation path of the program and execute the installation. The installation path should be consistent with the installation path of PostgreSQL.
    4. After the
    5. installation is completed, a dialog box will pop up to ask about the configuration of the grid function. Select as needed. Click "Yes" here to finally complete all the installation steps.

The Creation of PostGIS Database

First, make sure the PostgreSQL database service is started. Create a PostgreSQL database through pgAdmin to manage the PostGIS Spatial Data. The specific operations are as follows.

  1. Run pgAdmin, right-click Databases, and select Create > Database from the menu.
  2. Specify parameters such as database name (Database), management user (Owner), and Encode Type (Encoding).
  3. Click Save to finish creating the database.

SDX+ for PostGIS

Manage PostGIS Spatial Data in PostgreSQL database through SDX + for PostGIS engine. Using SuperMap desktop to manage PostGIS Spatial Data is simple and convenient, and all the maintenance work of related tables in PostgreSQL database is completed by SDX + for PostGIS engine.

The management of PostGIS Spatial Data generally includes: creating a database, creating a/Delete Data source, creating a/Delete Dataset, adding/deleting a record (Geometry), adding a/Delete Field in the Dataset, Update Field values, Query Data, and so on.

  • Creation of PostGIS Data source
      When creating a PostGIS Database-type Datasource
    • through the SuperMap desktop, you can either specify an existing PostgreSQL Database Name and create a Datasource; You can also specify a new Database Name. When creating a Datasource, the corresponding PostgreSQL database is created before the Datasource. Only one PostGIS Database-type Datasource can be created for a PostgreSQL database.
    • After
    • creating the PostGIS Database-type Datasource, a series of system tables for Datasource management will be added to the PostgreSQL database. Spatial Info
      Figure: Geomet; The y _ columns system table is used to record which tables have
      OGDC standard
      Figure: The spatial _ ref _ sys system table stores spatial Coordinate System information for the
    • In PostGIS Database-type Datasource, you can Create a Dataset or import data from other sources. Dataset types supported by SDX + for PostGIS engine include: point, line, surface, text, CAD, property sheet, 3D point/line/region/model, EPS composite point/line/region/text, grid, image, Mosaic Dataset。 In addition, if the specified database already has third-party Spatial Data conforming to the PostGIS Spatial Data structure, these data will also be read and managed by Datasource after the PostGIS Database-type Datasource is created.
  • PostGIS Spa tial Data editing

    SDX + for PostGIS supports various editing operations of Geometry:

    • Add/Remove Geometry: Many types of geometry can be added: points, lines, faces, text.
    • Edit Geometry: Support editing the nodes of Geometry, splitting Geometry, Donut Polygon processing, etc.
    • Geometry operations: basic Geometry operations such as merging and intersection are supported.
  • PostGIS Spa tial Data Display
    • SDX + for PostGIS supports the visualization of PostGIS Spatial Data, which can be used to make various thematic maps based on PostGIS spatial Configure Data style.
    • The operations of PostGIS Spatial Data supported
    • by SDX + for PostGIS engine are all realized by docking PostGIS functions, and PostGIS provides a large number of Spatial Data operation functions. Both Geometric Object Operation and Raster Data operation are included. Currently, PostGIS functions connected with SDX + for PostGIS engine can meet Map Cartography and basic Spatial Analysis operations. If your application needs go beyond this, refer to the PostGIS Reference Manual: https://postgis.net/docs/manual-2.4/
    • .