[postgis-tickets] [PostGIS] #3719: Error: Invalid number of points in LinearRing

PostGIS trac at osgeo.org
Thu Jun 29 02:16:39 PDT 2017


#3719: Error: Invalid number of points in LinearRing
-------------------------+---------------------------
  Reporter:  tiiipponen  |      Owner:  pramsey
      Type:  defect      |     Status:  new
  Priority:  medium      |  Milestone:  PostGIS 2.4.0
 Component:  postgis     |    Version:  2.3.x
Resolution:              |   Keywords:
-------------------------+---------------------------

Comment (by strk):

 Tricky problem to fix. It's about collapsed polygon due to reduced
 precision when going from curve to lines. Augmenting the number of
 segments should fix it. The default is 32, which collapses. Use 64 to get
 it right:
 {{{
 strk=# select ST_IsValid(ST_CurveToLine(
   ST_GeomFromText(
     'CURVEPOLYGON(
       COMPOUNDCURVE(
         CIRCULARSTRING(
           1.0441 2.9312,1.3959388 2.93601515,1.7478 2.9333
         ), (
           1.7478 2.9333,1.0441 2.9312
         )
       )
     )'
   )
 , 32));
 NOTICE:  IllegalArgumentException: Invalid number of points in LinearRing
 found 3 - must be 0 or >= 4
  st_isvalid
 ------------
  f
 (1 row)

 strk=# select ST_IsValid(ST_CurveToLine(
   ST_GeomFromText(
     'CURVEPOLYGON(
       COMPOUNDCURVE(
         CIRCULARSTRING(
           1.0441 2.9312,1.3959388 2.93601515,1.7478 2.9333
         ), (
           1.7478 2.9333,1.0441 2.9312
         )
       )
     )'
   )
 , 64));
  st_isvalid
 ------------
  t
 (1 row)
 }}}

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3719#comment:3>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list