

You can choose any other shape file which contain atleast this 3 files i.e. For instance to demonstrate import shapefile in postgresql, I have downloaded United state administrative boundary shape file.
#Postico commands for free#
If you don’t have any such shapefile, you may download the shapefile for free as suggested in the linked post. Import Shapefile in Postgresqlįor inserting shapefile to postgis, we first need to have one shapefile. If shp2pgsql is not installed, you should first download the same from the authentic website and then try to follow out the steps provided below. If you are linux or ubuntu system, you can check the same by running shp2pgsql command in terminal after navigating to “/usr/lib/postgresql” path. What does shp2pgsql command does? shp2pgsql is a command line tool, which helps in to convert or import single or multiple shapefiles into postgresql or postgis database tables. Also for running a command line tool to import shapefile you should check if shp2pgsql is available in your system and is installed. Prior to import Shapefile in Postgresql, we first need to install postgresql and PostGIS. Similarly you may also check for exporting shapefile from postgresql database. This makes developer to think for importing the shapefile data in postgresql and view attributes.

As shapefile is just a representation of Geo Data, while postgresql is database which support many GIS functionalities as like finding nearest neighbour, distance calculation from one point to another etc. PostGreSql Database support Spatial or GIS data. Shapefile is a data vector file, which stores GeoSpatial Data. Import Shapefile in Postgresql directly by command line tool.
