[postgis-users] geometry contains non-closed rings

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Tue Jul 1 03:01:24 PDT 2008


back slash wrote:
> hello
> 
> first i converted the shape files with shp2pgsql to sql files, then i tried to import them into postgis. some imports give this error message:
> 
> FEHLER:  geometry contains non-closed rings
> 
> somebody know how to find the non working lines in a reasonable time? it's senseless work to insert the sql files line by line..
> 
> cheers
> d


Hi d,

Instead of piping the shp2pgsql output directly into psql, try 
redirecting the output of shp2pgsql into a separate file, e.g.

shp2pgsql foo bar ... > shapefile.sql

If you then try loading the file separately using psql, psql should 
report the offending line number for you, i.e.:

psql -d mydatabase -f shapefile.sql


HTH,

Mark.

-- 
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063



More information about the postgis-users mailing list