1

I am new to PostGIS/PostgreSQL and have downloaded and installed to perform a spatial join which ideally takes 27 hours in ArcGIS Pro and 19 hours by ArcPy.Hoping for a faster results via PostGIS from what I read everywhere online.

I have installed both PostgreSQL and PostGIS. But I am unable to import a shapefile to the database. Basically I have a spatial table in Sql Server which I is somewhat challenging to import to pgAdmin as I cannot figure out a way to connect the database of sql server using ogr_fdw. The answer here does not help as I believe there are some restrictions in the organization end causing a failure as it only takes windows authentication.

As a workaround I converted the spatial table to a shapefile using feature to feature conversion. But now I am unable to import the shapefile to PostGIS/PostgreSQL. I am using the shp2pgsql GUI for importing and its throwing out a "Error reading shape output" as an error.

enter image description here

Any suggestion to have my spatial table imported to postgis or a way to get the converted shapefile imported?

  • your shapefile geometry is of type Polygon, the table in PostGIS defined with geometry MultiPolygon. both need to be the same; try setting Multipart to singlepart in Options (haven't used that tool for a while, but that options should be there...) – ThingumaBob Oct 25 '18 at 8:53
  • @ThingumaBob Tried that as well but gives an error: Shapefile type: Polygon PostGIS type: POLYGON[2] We have a Multipolygon with 2 parts, can't use -S switch! Shapefile import failed. – Deb Oct 25 '18 at 9:11
  • you know what, I was stupid; singleparts are exactly what you don´t want in a MultiPolygon table...,) you seem to have mixed geometry types (shapefile type 2 and 5 maybe?) in your shapefile, and object 130996 is causing the import to fail. – ThingumaBob Oct 25 '18 at 9:24
  • Did you manage to find a solution ? – Basile Aug 14 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.