Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import shape file into postgis? [closed]

I can find multiple tutorials that show how to import shapefiles to postgis via pgAdmin-3. But pgAdmin-3 is no longer supported.

How to do this with pgAdmin-4?

like image 371
Henrik K Avatar asked Nov 16 '16 15:11

Henrik K


People also ask

How to import a shapefile into QGIS using PostGIS?

First load the shapefile into QGIS and add a new connection via the "Add PostGIS Layers" button (elephant icon) on the left > "New". Then go to Database > DB Manager > DB Manager, select the newly created connection and open the import dialog (down arrow icon).

How to import shapefile in PostgreSQL?

Import Shapefile in Postgresql directly by command line tool. Shapefile is a data vector file, which stores GeoSpatial Data. PostGreSql Database support Spatial or GIS data.

How do I import spatial data from Esri to PostGIS?

The most common data format for spatial data has traditionally been the ESRI shapefile. shp2pgsql is a command line tool to import ESRI shapefiles to the database. Under Unix, you can use the following command for importing a new PostGIS table: On Windows it’s just as simple.

How to create a new database using the template_PostGIS?

Using PGAdminIII create a database using the template_postgis as a template, this copies all the triggers, functions and tables into a new database. Right click on the databases symbol and select 'new database': Then you can import data into it.


1 Answers

Disclaimer: I know this isn't a valid answer, but I don't have the reputation to comment.

I'd strongly recommend QGIS for this. The import dialog that comes with the Database Manager is rather great. First load the shapefile into QGIS and add a new connection via the "Add PostGIS Layers" button (elephant icon) on the left > "New". Then go to Database > DB Manager > DB Manager, select the newly created connection and open the import dialog (down arrow icon).

If you're into command line tools try ogr2ogr (http://www.bostongis.com/PrinterFriendly.aspx?content_name=ogr_cheatsheet)

like image 143
chris Avatar answered Oct 08 '22 19:10

chris