How to solve PostGIS-PostgreSQL shapefile import failed?

How to solve PostGIS-PostgreSQL shapefile import failed?

Simple solution: from the “SRID” in the PostGIS, Check the EPSG value from QGIS and paste it in the SRID then your problem is solved. I confirm that in most cases it is a column in your data called “geom” which duplicates with “geometry”.

Why is PostGIS unable to import spatial geometry?

This means that if you try to import a table/file with spatial geometry the Importer fails to load the data. To resolve this issue, you simply need to create/install the PostGIS extension correctly. In PGAdmin using the SQL window run the following script:

Why is PostGIS not installed in Postgres database?

Sometimes when installing a Postgres database, the extension PostGIS is not successfully installed. This means that if you try to import a table/file with spatial geometry the Importer fails to load the data. To resolve this issue, you simply need to create/install the PostGIS extension correctly.

How can I import data from QGIS to PostGIS?

Inside QGIS you can do data import through DB Manager, but I recommend using Export to PostgreSQL, as it is using COPY statements in the background rather than INSERTS and performance is much better. You can load data layers from the project or from disk.

How to import a shapefile to PostGIS with ogr2ogr?

As you discovered by trial and error, there were few nagging issues you needed to fix, the last of which was resolved using ogr2ogr’s -nlt GEOMETRY * argument.

How to test PostGIS import with shp2pgsql?

I would have been stumped by your second error for awhile, but by testing your SQL user with a different import utility (shp2pgsql), which was smart, you got a more precise error message and gave your SQL user necessary privileges on the spatial_ref_sys table.

How to import spatial data into PostGIS database?

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:

How can I import data from OpenStreetMap to PostGIS?

OpenStreetMap: OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. Many people refer to OSM as the Wikipedia of maps. If you seek easy ways to get an extract of the data, you can check for GeoFabrik for Shapefiles or osmdata.xyz for GeoPackages. OpenStreetMap data from Africa.