[postgis-devel] [PostGIS] #920: ST_LineToCurve generating invalid CURVEPOLYGON (was: CURVEPOLYGON problem when converting to/from text)

PostGIS trac at osgeo.org
Fri Apr 22 02:02:54 PDT 2011


#920: ST_LineToCurve generating invalid CURVEPOLYGON
---------------------+------------------------------------------------------
 Reporter:  debe     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 1.5.3
Component:  postgis  |     Version:  1.5.X        
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by robe):

 Debe,

 I stand corrected.  This is a bug.  We might have it listed elsewhere
 though so this is possibly a duplicate.


 {{{
 SELECT ST_AsBinary(st_linetocurve((a.dmp).geom))::geometry,
 (a.dmp).path[1]
 from (select (st_dump(st_intersection(
         st_geomfromtext('MULTIPOLYGON(((712689.216 93000.59,712688.76
 92998.407,712688.51 93000.12,712686.158 92989.673,712687.745
 92991.988,712690.604 92992.607,712744.133 92982.662,712745.72
 92993.198,712748.125 93010.567,712754.121 93047.863,712759.68
 93082.452,712760.038 93084.678,712763.038 93103.339,712766.084
 93122.291,712769.096 93141.025,712769.512 93142.974,712769.818
 93145.835,712729.62 93152.531,712725.856 93155.219,712724.852
 93159.263,712721.511 93144.296,712724.049 93147.062,712728.895
 93148.428,712759.991 93143.31,712763.796 93140.681,712765.057
 93136.483,712763.882 93126.566,712760.999 93109.576,712757.33
 93087.96,712751.997 93052.948,712748.734 93031.529,712745.399
 93009.635,712743.16 92996.77,712741.116 92991.556,712737.223
 92988.483,712732.131 92988.048,712718.157 92990.536,712692.299
 92995.698,712692.146430423 92995.7326960549,712691.956537615
 92995.7847712311,712691.76942875 92995.8461012788,712691.585554588
 92995.9165384487,712691.405358098 92995.9959130514,712691.229273391
 92996.0840338666,712691.057724668 92996.1806886035,712690.891125207
 92996.2856444124,712690.729876359 92996.3986484455,712690.574366588
 92996.5194284663,712690.42497053 92996.647693505,712690.282048093
 92996.78313456,712690.14594359 92996.925425342,712690.016984909
 92997.0742230598,712689.895482722 92997.2291692469,712689.781729739
 92997.3898906243,712689.676 92997.556,712689.666391782
 92997.5738378773,712689.566317179 92997.772173345,712689.476094981
 92997.9751803369,712689.39594254 92998.1823697915,712689.326052951
 92998.3932425711,712689.266594584 92998.6072906649,712689.21771068
 92998.8239984121,712689.179519003 92999.0428437448,712689.152111562
 92999.2632994455,712689.135554382 92999.4848344171,712689.129887353
 92999.7069149624,712689.135124125 92999.9290060699,712689.151252083
 93000.1505727028,712689.178232374 93000.3710810874,712689.216
 93000.59)))')
         ,
         st_geomfromtext('MULTIPOLYGON(((712688.51 93000.12,712688.76
 92998.407,712689.216 93000.59,712689.178 93000.371,712689.151
 93000.151,712689.135 92999.929,712689.13 92999.707,712689.136
 92999.485,712689.152 92999.263,712689.18 92999.043,712689.218
 92998.824,712689.267 92998.607,712689.326 92998.393,712689.396
 92998.182,712689.476 92997.975,712689.566 92997.772,712689.666
 92997.574,712689.676 92997.556,712689.782 92997.39,712689.895
 92997.229,712690.017 92997.074,712690.146 92996.925,712690.282
 92996.783,712690.425 92996.648,712690.574 92996.519,712690.73
 92996.399,712690.891 92996.286,712691.058 92996.181,712691.229
 92996.084,712691.405 92995.996,712691.586 92995.917,712691.769
 92995.846,712691.95792995.785,712692.146 92995.733,712692.299
 92995.698,712718.157 92990.536,712732.131 92988.048,712737.223
 92988.483,712741.116 92991.556,712743.16 92996.77,712745.399
 93009.635,712748.734 93031.529,712751.997 93052.948,712757.33
 93087.96,712760.999 93109.576,712763.882 93126.566,712765.057
 93136.483,712763.796 93140.681,712759.991 93143.31,712728.895
 93148.428,712724.049 93147.062,712721.511 93144.296,712719.191
 93133.901,712715.238 93116.662,712710.232 93095.495,712702.672
 93062.116,712695.398 93030.153,712688.51 93000.12)))')
 ))) as dmp) a where geometrytype((a.dmp).geom)='POLYGON' AND
 (a.dmp).path[1] = 23;
 }}}

 Since this results in an error: LineString must have at least two points
 and binary should have kept the precision if it was a precision issue.

 Seems ot be an issue in our 2.0 as well.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/920#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-devel mailing list