[postgis-devel] ST_CircularString and circle definition
Sandro Santilli
strk at keybit.net
Wed Oct 9 02:27:01 PDT 2013
Mateusz, beside reading the book, have you tried the actual code ?
I believe that curve-to-line code already contains special case for
single-arc representing full circle, but line-to-curve might fall
short of correctly providing the diametrical opposite as control
point as it tends to re-use existing vertices.
I suggest you make some tests and file tickets if appropriate
(there might be some already, about curves).
--strk;
On Tue, Oct 08, 2013 at 01:46:17PM +0100, Mateusz Loskot wrote:
> Hi,
>
> According to the latest version of "SQL/MM Part 3: Spatial" which I've
> got access too,
> section4.1.6 ST_CircularString, the special case of a circle defined as
> ST_CircualString is this:
>
> """
> In the special case where a segment is a complete circle, that is, the start
> and end points are coincident, then the intermediate point shall be
> the midpoint of the segment
> """
>
> So, a circle is represented as a single arc segment of 3 points.
>
> However, AFAIU, PostGIS docs as well examples in PostGIS in Action
> book seems to differ
> and require two arc segments of 5 points to represent a circle.
>
> SQL Server docs also state [2] the requirement of two semi-circle
> segments (5 points):
>
> """
> A CircularString instance cannot use a single circular arc segment
> (such as (1 1, 3 1, 1 1)) to define a complete circle. Use (1 1, 2 2,
> 3 1, 2 0, 1 1) to define the circle.
> """
>
> Could anyone confirm my understanding of the difference between the
> implementations
> and SQL/MM spec is sound?
> If it is, why PostGIS does not follow the SQL/MM spec regarding the circle?
>
> [1] http://jtc1sc32.org/doc/N1101-1150/N1101-1150.html
> [2] http://msdn.microsoft.com/en-us/library/ff929141.aspx
>
> Best regards,
> --
> Mateusz Loskot, http://mateusz.loskot.net
More information about the postgis-devel
mailing list