GIS Tutorial
  • Home
  • About
  • Contact

Popular Posts

How to open Mapinfo TAB file on QGIS
QGIS,

How to open Mapinfo TAB file on QGIS

by adminJanuary 1, 20181 comment
How to Create a GeoPackage on QGIS 3.2
QGIS,

How to Create a GeoPackage on QGIS 3.2

by adminJuly 25, 2018no comment
How to Export Layer to Shapefile on QGIS
QGIS,

How to Export Layer to Shapefile on QGIS

by adminSeptember 21, 2018no comment
How to convert polyline to polygon on QGIS 3.0
QGIS,

How to convert polyline to polygon on QGIS 3.0

by adminJune 12, 2018no comment

Category List

  • ArcGIS (75)
  • Database (34)
  • Free Spatial Data (2)
  • General (5)
  • GIS Software (20)
  • Global Mapper (20)
  • Leapfrog Geo (15)
  • Mapinfo (40)
  • Micromine (28)
  • Programming (2)
  • QGIS (98)
  • Software Review (1)
  • Surfer (2)
  • Uncategorized (4)

Follow Us

Instagram

Instagram has returned invalid data.
GIS Tutorial
  • Home
  • About
  • Contact
Database, QGIS,

How to Export Shapefile to PostGIS

by adminNovember 18, 2019no comment
1
Shares
Share on FacebookShare on Twitter
person-typing-on-computer-keyboard-2058128

Hello everyone, welcome to GIS Tutorial. Today, I am going to discuss a bit deeper about PostGIS. We will learn how to export shapefile to PostGIS. There are several ways to do this job and also there are software that capable to export gis file to PostGIS. In this article, I am going to show you the following software:

  • Global Mapper
  • QGIS
  • ogr2ogr

Prerequisites

Before we can continue with the steps, I assume you already have a working PostGIS server. PostGIS is a spatial extension for PostgreSQL database. Read this How to Install PostGIS on Ubuntu 18.04 to get started. The PostGIS can be installed on a local or remote computer.

Export Shapefile to PostGIS using Global Mapper

Global Mapper is one of my favorite GIS Software for Windows. It has all capability to open almost any of GIS file formats. It can be used to translate or export shapefile to PostGIS database easily. I have used the following steps to export my spatial dataset to PostGIS.

Steps to export shapefile to PostGIS using Global Mapper

  1. Open Global Mapper
  2. Load/Open the shapefile to Global Mapper
  3. Go to File | Export | Export Vector Spatial Database
  4. Choose “Select Spatial Database Connection (ArcSDE, PostGIS)” from the list.
  5. Choose the PostGIS connection or create a new one if you don’t have it yet. Click Open to open the connection
  6. Give a name for the exported table.
  7. Click OK

To open the spatial table from PostGIS on other software, you can follow the tutorial below

How to open PostGIS Table on QGIS

How to Export Shapefile to PostGIS using QGIS

QGIS is a popular GIS Software. It supports PostGIS very well. You can open the PostGIS table directly from QGIS. Not only that, we can also export spatial tables to PostGIS using QGIS.

Steps to export shapefile to PostGIS using QGIS

  1. Open QGIS
  2. Double-click “Export to PostgreSQL” from the Toolbox
  3. Browse the layer file to export
  4. Choose the database connection name
  5. Click Run

Pretty simple isn’t it?

Export Shapefile to PostGIS using ogr2ogr tool

ogr2ogr is a command line tool that has many capabilities including export shapefile and other GIS formats to PostGIS, MySQL, SQL Server etc. ogr2ogr tool is available from FWTools. You can download it for free. Or, you can also download and install QGIS that includes ogr2ogr tool.

How to use ogr2ogr to export shapefile to PostGIS database

ogr2ogr -f "ESRI Shapefile" C:\Users\dhani\Documents\ArcGIS\Contour_TW.shp PG:"host=192.168.100.14 user=postgres dbname=gis_database password=12345" "test"

The command above will export the Contour_TW.shp file to remote PostGIS database at 192.168.100.14 and save it as table name Test.

So there are many ways to export spatial table to PostGIS database. Thank you for reading this article and I hope you enjoy it. Cheers.

postgisqgis tutorial
Previous

Display an Aerial Photograph on Micromine

November 13, 2019
Next

QGIS Tutorial – How to Add New Column to a Table

November 18, 2019

Leave a Reply Cancel reply

Trending

  • How to Extract Raster Value to Point Layer in ArcGIS Pro

    How to Extract Raster Value to Point Layer in ArcGIS Pro

    1 week ago
  • How to Convert 5 GB Tiff into JPEG Easily

    How to Convert 5 GB Tiff into JPEG Easily

    2 weeks ago
  • Finally, I Can Run Oasis Montaj on My Macbook Pro M1

    Finally, I Can Run Oasis Montaj on My Macbook Pro M1

    2 weeks ago
  • How to Run ArcGIS Pro on Macbook Pro M1 and M2

    How to Run ArcGIS Pro on Macbook Pro M1 and M2

    2 weeks ago
  • ArcGIS
  • Database
  • Free Spatial Data
  • General
  • GIS Software
  • Global Mapper
  • Leapfrog Geo
  • Mapinfo
  • Micromine
  • Programming
  • QGIS
  • Software Review
  • Surfer
  • Uncategorized

Ads




Ads




Pages