[postgis-tickets] [PostGIS] #3541: Automatically convert Polygon to CurvePolygon when required

PostGIS trac at osgeo.org
Mon May 2 02:45:45 PDT 2016


#3541: Automatically convert Polygon to CurvePolygon when required
---------------------------------------------+----------------------------
 Reporter:  mkuhn                            |      Owner:  pramsey
     Type:  enhancement                      |     Status:  new
 Priority:  medium                           |  Milestone:  PostGIS Future
Component:  postgis                          |    Version:  2.2.x
 Keywords:  curve, curvepolygon, conversion  |
---------------------------------------------+----------------------------
 When trying to insert a regular Polygon into a table with CurvePolygon
 type the operation fails with an error

 {{{
 ERROR:  Geometry type (Polygon) does not match column type (CurvePolygon)
 }}}

 As far as I understand, the conversion from Polygon to CurvePolygon is
 lossless. Could this conversion be done implicitly? I cannot imagine a
 case where a user will take another action than adding an explicit
 conversion step from Polygon to CurvePolygon after seeing this message, so
 it might as well just happen implicitly.

 The fact that at the moment there is no way to convert from Polygon to
 CurvePolygon apart from going through WKT (see #1291) makes this issue
 even more painful.

 The same applies to LineString > CircularString and conceptually also to
 MultiCurve (untested).

 {{{
 > SELECT ST_GeomFromText('LINESTRING(75.15 29.53,77 29,77.6
 29.5)')::geometry('CircularString');

 ERROR:  Geometry type (LineString) does not match column type
 (CircularString)
 }}}

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3541>
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