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

PostGIS trac at osgeo.org
Tue Jul 12 07:19:27 PDT 2016


#3541: Automatically convert Polygon to CurvePolygon when required
--------------------------+---------------------------------------------
  Reporter:  mkuhn        |      Owner:  pramsey
      Type:  enhancement  |     Status:  reopened
  Priority:  medium       |  Milestone:  PostGIS Future
 Component:  postgis      |    Version:  2.2.x
Resolution:               |   Keywords:  curve, curvepolygon, conversion
--------------------------+---------------------------------------------
Changes (by mkuhn):

 * status:  closed => reopened
 * resolution:  wontfix =>


Comment:

 I meant to write COMPOUNDCURVE which can be converted from LINESTRING in a
 lossless way. Sorry for bringing in CIRCULARLINESTRING which raises an
 exception for good reasons.

 I.e.
 {{{
 SELECT ST_GeomFromText('LineString(75.15 29.53,77 29,77.6
 29.5)')::geometry('CompoundCurve');
 }}}

 can easily be upcasted to

 {{{
 SELECT ST_GeomFromText('CompoundCurve((75.15 29.53,77 29,77.6 29.5))')
 }}}

 The same holds true for CurvePolygon (which is in the title).

 {{{
 SELECT ST_GeomFromText('Polygon((0 0,1 1,1 0,0
 0))')::geometry('CurvePolygon');
 }}}

 has exactly the same representation as

 {{{
 SELECT ST_GeomFromText('CurvePolygon((0 0,1 1,1 0,0 0))');
 }}}

 The current situation is equal to not being able to cast an integer to a
 float.

 {{{
 select 1::float;
 }}}

 Please note, that this issue only concerns upcasting, downcasting from
 curve to non-curve types can be forbidden by definition even though
 possible in some scenarios.

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