[postgis-users] newbie question about non closed rings

G. van Es gves2000 at yahoo.com
Wed Apr 15 10:43:53 PDT 2009


Thanks for pointing me in this direction. 
Trying the following however doesn't give me the desired result.

select st_isvalid(ST_SnapToGrid('01060000000100000001030000000100000017000000F16E09F3BEB70041931C90EF94731941E8FBA9F157B70041713D0AD78C73194130DD24062BB600416BBC7413787319419CC420B0F1B50041DE24060174731941C3F5285CF1B5004179E9263175731941B5C876BEF0B50041DBF97E6A7773194100000000EAB50041D7A370BD8F731941C520B072E9B5004185EB51B8917319416991ED7CE5B5004100000000A07319418C6CE7FBDCB50041BF9F1AAFBE731941D578E926AEB50041B39DEFA76574194121B07268E6B50041D578E9A6697419415939B4C810B70041B5C8763E7E7419419418045679B700415C8FC27586741941AA9A096982B700411CBA7F12677419418FF6FD8BA3B700419D553774F4731941815E0E35AEB7004174547794CF7319418B08F52DB1B700417652884CC5731941C49D7A24B7B70041FFECFAAAB07319415D8FC2F5BBB7004100000000A0731941115839B4BDB70041D122DBF99973194119970B76BEB7004172266DE996731941C5B908F3BEB70041CEF992EF94731941',0.0001));

ERROR:  geometry contains non-closed rings



--- On Wed, 4/15/09, Kevin Neufeld <kneufeld at refractions.net> wrote:

> From: Kevin Neufeld <kneufeld at refractions.net>
> Subject: Re: [postgis-users] newbie question about non closed rings
> To: "PostGIS Users Discussion" <postgis-users at postgis.refractions.net>
> Date: Wednesday, April 15, 2009, 8:39 AM
> You could try snapping your
> geometries to a grid after they are in the database.
> 
> http://postgis.refractions.net/documentation/manual-svn/ST_SnapToGrid.html
> 
> 
> postgis=# SELECT
> ST_IsValid('0106000000010000000103000000010000000700000024213D12AA7BFD40945FF42576511941676A32F9017BFD40B1D67BEA7E511941C3E3C640DB7DFD4026CE38F4EE531941C91289C5AA7EFD40017B8518E3531941646F1599AB7DFD409627F1F0AE521941355EBA49547CFD407B14AEC74652194123213D12AA7BFD40945FF42576511941');
> NOTICE:  IllegalArgumentException: points must form a
> closed linestring
>  st_isvalid
> ------------
>  f
> (1 row)
> 
> 
> postgis=# SELECT
> ST_IsValid(ST_SnapToGrid('0106000000010000000103000000010000000700000024213D12AA7BFD40945FF42576511941676A32F9017BFD40B1D67BEA7E511941C3E3C640DB7DFD4026CE38F4EE531941C91289C5AA7EFD40017B8518E3531941646F1599AB7DFD409627F1F0AE521941355EBA49547CFD407B14AEC74652194123213D12AA7BFD40945FF42576511941',
> 0.00001));
>  st_isvalid
> ------------
>  t
> (1 row)
> 
> 
> -- Kevin
> 
> G. van Es wrote:
> > The shapefile is created with software from Bentley.
> > PostgreSQL is version 8.3.4 on Ubuntu
> > PostGis is version 1.3
> > 
> > I also see a difference between conversion as WKB and
> WKT (-w option). If I use shp2pgsql with the -w option there
> are far less records that fail.
> > 
> > So can this be an issue with rounding up numbers? In
> WKT I see a tiny difference between some start and end
> points on failing records.
> > 
> > And if so, is there a possibility to ignore those tiny
> differences?
> > 
> > Thanks again,
> > Ge
> > 
> > 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 


      



More information about the postgis-users mailing list