[postgis-devel] [PostGIS] #2002: Circle geometry handling
PostGIS
trac at osgeo.org
Mon Sep 17 04:08:18 PDT 2012
#2002: Circle geometry handling
----------------------+-----------------------------------------------------
Reporter: xificurk | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 2.0.2
Component: postgis | Version: 2.0.x
Keywords: |
----------------------+-----------------------------------------------------
The documentation states in 4.1.3. SQL-MM Part 3:
"The exception to this is for a closed circle, where the start and end
points are the same. In this case the second point MUST be the center of
the arc, ie the opposite side of the circle."
But it seems that postgis does not handle these geometries well.
=> SELECT
ST_AsText(ST_CurveToLine(ST_GeomFromText('CURVEPOLYGON(CIRCULARSTRING(-1
0,1 0,-1 0))')));
st_astext
--------------------------
POLYGON((1 0,-1 0,-1 0))
The result is invalid polygon. The workaround is simple - use more points
in circular string, e.g.:
=> SELECT
ST_AsText(ST_CurveToLine(ST_GeomFromText('CURVEPOLYGON(CIRCULARSTRING(-1
0, 0 1, 1 0, 0 -1, -1 0))'), 2));
st_astext
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
POLYGON((-1 1.22460635382238e-16,-0.707106781186547
0.707106781186548,6.12303176911189e-17 1,0.707106781186548
0.707106781186547,1 0,0.707106781186548
-0.707106781186547,6.12303176911189e-17 -1,-0.707106781186547
-0.707106781186548,-1 0))
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2002>
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