I have shapefiles which I have loaded in postgis and now i am trying to use geometric function in postgis like ST_intersect and they fail because the data is not topological correct.

I have tried to use the function st_isvalid and others and could not correct the data. As a last resort i have loaded the data into grass which automatically builds topology and trying to export that layer into postgis fails with an error saying gid already exist.

Also, trying to export as a shapefile works but i encounter a problem when i load the shapefile back to postgis and try to do my clip as it complains that geometric column contains z column but geometry does not.

How best can i attend to these?


1 Answer 1


There is no magic bullet to kill topology errors. You must first understand the nature of such errors to best find a solution.

What is the geometry type? Polygon, line ?

For example, polygon errors come in many flavors: polygons can be opened, can have self intersections, etc. Lines can also have self intersections.

I suggest you convert one of the smallest geometries in which you have these errors into WKT and post it here, in order to get additional help.

It might be helpful also to know the source of such geometries. Are they originating from CAD software, from GPS device software, are they manually digitized?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.