Webgis the process of storing, editing and releasing spatial data in open source solution

Source: Internet
Author: User
Tags postgis

1. Preface

The framework for this open source scenario is: GeoServer (server) +tomcat (middleware) +postgis (database) +udig (desktop).

This article will focus on how to import shp data through PostGIS into PostgreSQL, show and edit on Udig, and then publish the layer data in PostgreSQL through GeoServer.

2. Storing SHP data in 2.1 environment via PostGIS

Must be fitted with Postgresql+postgis. After the installation is complete, you can see in the program directory:

2.2. Warehousing

A. Click this tool and a dialog box will appear:

B. Setting up a connection to a database

Click Connection to set the connection properties in the popup dialog box:

Successful connection will have the following log:

Note: database in this database must be integrated with PostGIS databases, otherwise the spatial data cannot be imported.

C. Selecting the SHP data to import

Clicking on Add File will bring up the following dialog box:

Select the SHP data that you want to import, and then click OK when you are finished:

Note:the folder path where SHP is located must be in English, otherwise import fails when importing.

D. Data import

Note: First click on options to encode the settings. According to my test, the import error occurs when the UTF-8 encoding has Chinese properties in the layer. It is recommended that the encoding be set to: GBK.

Click Import to start importing. After the import is successful, the following logs are available:

E. View the imported SHP data in PostgreSQL:

3. View and edit the SHP data 3.1 environment in PostgreSQL via Udig

Need to have Udig software installed. After successful installation, you can see in the program directory:

3.2 Viewing data in the PostGIS in Udig

A. Click Layer-->add, select PostGIS:

B. Fill in the connection properties:

C. Add the layers in the PostGIS to the current map:

The added layers are shown in D.udig:

3.3 Editing a layer

When you are finished editing, click Enter:

Note: Be sure to click on the toolbar in order for the edits to be submitted successfully.

4. Publish the SHP Data 4.1 environment in PostgreSQL via GeoServer

A geoserver service needs to be published. After the publication is successful, you can open the Web page in a browser:

4.2 Publishing a Map service

A. Click Stores-->add Stores-->postgis to fill in the connection properties in the entry page:

B. Select the SHP layer you want to publish:

C. Fill in the Layer information:

D. Publishing services and viewing:

When you click Save, the layer is published successfully. You can view the published layers in Layer preview:

Note: you can clearly see that the features edited by Udig have been successfully saved.

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

Webgis the process of storing, editing and releasing spatial data in open source solution

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.