public inbox for [email protected]help / color / mirror / Atom feed
Geometric function example results 4+ messages / 2 participants [nested] [flat]
* Geometric function example results @ 2011-06-23 12:09 Thom Brown <[email protected]> 0 siblings, 2 replies; 4+ messages in thread From: Thom Brown @ 2011-06-23 12:09 UTC (permalink / raw) To: pgsql-docs Hi, I noticed that there are no example outputs shown on the geometric functions page (http://www.postgresql.org/docs/9.0/static/functions-geometry.html). So I've attached a patch which adds them. I'm not entirely sure to make of the 2 example outputs that are very large, but they're included anyway. Are these worth adding? Thanks Thom Brown Twitter: @darkixion IRC (freenode): dark_ixion Registered Linux user: #516935 EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company Attachments: [application/octet-stream] geom_function_examples.patch (12.4K, 2-geom_function_examples.patch) download | inline diff: diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 628fbef..bb32314 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -7677,6 +7677,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <entry>Return Type</entry> <entry>Description</entry> <entry>Example</entry> + <entry>Result</entry> </row> </thead> <tbody> @@ -7685,60 +7686,70 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <entry><type>double precision</type></entry> <entry>area</entry> <entry><literal>area(box '((0,0),(1,1))')</literal></entry> + <entry><literal>1</literal></entry> </row> <row> <entry><literal><function>center(<replaceable>object</>)</function></literal></entry> <entry><type>point</type></entry> <entry>center</entry> <entry><literal>center(box '((0,0),(1,2))')</literal></entry> + <entry><literal>(0.5,1)</literal></entry> </row> <row> <entry><literal><function>diameter(<type>circle</>)</function></literal></entry> <entry><type>double precision</type></entry> <entry>diameter of circle</entry> <entry><literal>diameter(circle '((0,0),2.0)')</literal></entry> + <entry><literal>4</literal></entry> </row> <row> <entry><literal><function>height(<type>box</>)</function></literal></entry> <entry><type>double precision</type></entry> <entry>vertical size of box</entry> <entry><literal>height(box '((0,0),(1,1))')</literal></entry> + <entry><literal>1</literal></entry> </row> <row> <entry><literal><function>isclosed(<type>path</>)</function></literal></entry> <entry><type>boolean</type></entry> <entry>a closed path?</entry> <entry><literal>isclosed(path '((0,0),(1,1),(2,0))')</literal></entry> + <entry><literal>true</literal></entry> </row> <row> <entry><literal><function>isopen(<type>path</>)</function></literal></entry> <entry><type>boolean</type></entry> <entry>an open path?</entry> <entry><literal>isopen(path '[(0,0),(1,1),(2,0)]')</literal></entry> + <entry><literal>true</literal></entry> </row> <row> <entry><literal><function>length(<replaceable>object</>)</function></literal></entry> <entry><type>double precision</type></entry> <entry>length</entry> <entry><literal>length(path '((-1,0),(1,0))')</literal></entry> + <entry><literal>4</literal></entry> </row> <row> <entry><literal><function>npoints(<type>path</>)</function></literal></entry> <entry><type>int</type></entry> <entry>number of points</entry> <entry><literal>npoints(path '[(0,0),(1,1),(2,0)]')</literal></entry> + <entry><literal>3</literal></entry> </row> <row> <entry><literal><function>npoints(<type>polygon</>)</function></literal></entry> <entry><type>int</type></entry> <entry>number of points</entry> <entry><literal>npoints(polygon '((1,1),(0,0))')</literal></entry> + <entry><literal>2</literal></entry> </row> <row> <entry><literal><function>pclose(<type>path</>)</function></literal></entry> <entry><type>path</type></entry> <entry>convert path to closed</entry> <entry><literal>pclose(path '[(0,0),(1,1),(2,0)]')</literal></entry> + <entry><literal>((0,0),(1,1),(2,0))</literal></entry> </row> <![IGNORE[ <!-- Not defined by this name. Implements the intersection operator '#' --> @@ -7747,6 +7758,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <entry><type>point</type></entry> <entry>intersection</entry> <entry><literal>point(lseg '((-1,0),(1,0))',lseg '((-2,-2),(2,2))')</literal></entry> + <entry><literal></literal></entry> </row> ]]> <row> @@ -7754,18 +7766,21 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <entry><type>path</type></entry> <entry>convert path to open</entry> <entry><literal>popen(path '((0,0),(1,1),(2,0))')</literal></entry> + <entry><literal>[(0,0),(1,1),(2,0)]</literal></entry> </row> <row> <entry><literal><function>radius(<type>circle</type>)</function></literal></entry> <entry><type>double precision</type></entry> <entry>radius of circle</entry> <entry><literal>radius(circle '((0,0),2.0)')</literal></entry> + <entry><literal>2</literal></entry> </row> <row> <entry><literal><function>width(<type>box</>)</function></literal></entry> <entry><type>double precision</type></entry> <entry>horizontal size of box</entry> <entry><literal>width(box '((0,0),(1,1))')</literal></entry> + <entry><literal>1</literal></entry> </row> </tbody> </tgroup> @@ -7780,6 +7795,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <entry>Return Type</entry> <entry>Description</entry> <entry>Example</entry> + <entry>Result</entry> </row> </thead> <tbody> @@ -7793,18 +7809,21 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <entry><type>box</type></entry> <entry>circle to box</entry> <entry><literal>box(circle '((0,0),2.0)')</literal></entry> + <entry><literal>(1.41421356237309,1.41421356237309),(-1.41421356237309,-1.41421356237309)</literal></entry> </row> <row> <entry><literal><function>box(<type>point</type>, <type>point</type>)</function></literal></entry> <entry><type>box</type></entry> <entry>points to box</entry> <entry><literal>box(point '(0,0)', point '(1,1)')</literal></entry> + <entry><literal>(1,1),(0,0)</literal></entry> </row> <row> <entry><literal><function>box(<type>polygon</type>)</function></literal></entry> <entry><type>box</type></entry> <entry>polygon to box</entry> <entry><literal>box(polygon '((0,0),(1,1),(2,0))')</literal></entry> + <entry><literal>(2,1),(0,0)</literal></entry> </row> <row> <entry> @@ -7816,18 +7835,21 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <entry><type>circle</type></entry> <entry>box to circle</entry> <entry><literal>circle(box '((0,0),(1,1))')</literal></entry> + <entry><literal><(0.5,0.5),0.707106781186548></literal></entry> </row> <row> <entry><literal><function>circle(<type>point</type>, <type>double precision</type>)</function></literal></entry> <entry><type>circle</type></entry> <entry>center and radius to circle</entry> <entry><literal>circle(point '(0,0)', 2.0)</literal></entry> + <entry><literal><(0,0),2></literal></entry> </row> <row> <entry><literal><function>circle(<type>polygon</type>)</function></literal></entry> <entry><type>circle</type></entry> <entry>polygon to circle</entry> <entry><literal>circle(polygon '((0,0),(1,1),(2,0))')</literal></entry> + <entry><literal><(1,0.333333333333333),0.924950591148529></literal></entry> </row> <row> <entry> @@ -7839,12 +7861,14 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <entry><type>lseg</type></entry> <entry>box diagonal to line segment</entry> <entry><literal>lseg(box '((-1,0),(1,0))')</literal></entry> + <entry><literal>[(1,0),(-1,0)]</literal></entry> </row> <row> <entry><literal><function>lseg(<type>point</type>, <type>point</type>)</function></literal></entry> <entry><type>lseg</type></entry> <entry>points to line segment</entry> <entry><literal>lseg(point '(-1,0)', point '(1,0)')</literal></entry> + <entry><literal>[(-1,0),(1,0)]</literal></entry> </row> <row> <entry> @@ -7856,6 +7880,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <entry><type>point</type></entry> <entry>polygon to path</entry> <entry><literal>path(polygon '((0,0),(1,1),(2,0))')</literal></entry> + <entry><literal>((0,0),(1,1),(2,0))</literal></entry> </row> <row> <entry> @@ -7868,30 +7893,35 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <entry><type>point</type></entry> <entry>construct point</entry> <entry><literal>point(23.4, -44.5)</literal></entry> + <entry><literal>(23.4,-44.5)</literal></entry> </row> <row> <entry><literal><function>point(<type>box</type>)</function></literal></entry> <entry><type>point</type></entry> <entry>center of box</entry> <entry><literal>point(box '((-1,0),(1,0))')</literal></entry> + <entry><literal>(0,0)</literal></entry> </row> <row> <entry><literal><function>point(<type>circle</type>)</function></literal></entry> <entry><type>point</type></entry> <entry>center of circle</entry> <entry><literal>point(circle '((0,0),2.0)')</literal></entry> + <entry><literal>(0,0)</literal></entry> </row> <row> <entry><literal><function>point(<type>lseg</type>)</function></literal></entry> <entry><type>point</type></entry> <entry>center of line segment</entry> <entry><literal>point(lseg '((-1,0),(1,0))')</literal></entry> + <entry><literal>(0,0)</literal></entry> </row> <row> <entry><literal><function>point(<type>polygon</type>)</function></literal></entry> <entry><type>point</type></entry> <entry>center of polygon</entry> <entry><literal>point(polygon '((0,0),(1,1),(2,0))')</literal></entry> + <entry><literal>(1,0.333333333333333)</literal></entry> </row> <row> <entry> @@ -7903,24 +7933,40 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple <entry><type>polygon</type></entry> <entry>box to 4-point polygon</entry> <entry><literal>polygon(box '((0,0),(1,1))')</literal></entry> + <entry><literal>((0,0),(0,1),(1,1),(1,0))</literal></entry> </row> <row> <entry><literal><function>polygon(<type>circle</type>)</function></literal></entry> <entry><type>polygon</type></entry> <entry>circle to 12-point polygon</entry> <entry><literal>polygon(circle '((0,0),2.0)')</literal></entry> + <entry> + <literal> + ((-2,0),(-1.73205080756888,1),(-1,1.73205080756888),(-1.22464679914735e-16,2),(1,1.73205080756888), + (1.73205080756888,1),(2,2.44929359829471e-16),(1.73205080756888,-1),(1,-1.73205080756888), + (3.67394039744206e-16,-2),(-0.999999999999999,-1.73205080756888),(-1.73205080756888,-1)) + </literal> + </entry> </row> <row> <entry><literal><function>polygon(<replaceable class="parameter">npts</replaceable>, <type>circle</type>)</function></literal></entry> <entry><type>polygon</type></entry> <entry>circle to <replaceable class="parameter">npts</replaceable>-point polygon</entry> <entry><literal>polygon(12, circle '((0,0),2.0)')</literal></entry> + <entry> + <literal> + ((-2,0),(-1.73205080756888,1),(-1,1.73205080756888),(-1.22464679914735e-16,2),(1,1.73205080756888), + (1.73205080756888,1),(2,2.44929359829471e-16),(1.73205080756888,-1),(1,-1.73205080756888), + (3.67394039744206e-16,-2),(-0.999999999999999,-1.73205080756888),(-1.73205080756888,-1)) + </literal> + </entry> </row> <row> <entry><literal><function>polygon(<type>path</type>)</function></literal></entry> <entry><type>polygon</type></entry> <entry>path to polygon</entry> <entry><literal>polygon(path '((0,0),(1,1),(2,0))')</literal></entry> + <entry><literal>((0,0),(1,1),(2,0))</literal></entry> </row> </tbody> </tgroup> ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Geometric function example results @ 2011-06-27 14:31 Thom Brown <[email protected]> parent: Thom Brown <[email protected]> 1 sibling, 0 replies; 4+ messages in thread From: Thom Brown @ 2011-06-27 14:31 UTC (permalink / raw) To: pgsql-docs On 23 June 2011 13:09, Thom Brown <[email protected]> wrote: > Hi, > > I noticed that there are no example outputs shown on the geometric > functions page (http://www.postgresql.org/docs/9.0/static/functions-geometry.html). > So I've attached a patch which adds them. I'm not entirely sure to > make of the 2 example outputs that are very large, but they're > included anyway. > > Are these worth adding? Any opinions on this? -- Thom Brown Twitter: @darkixion IRC (freenode): dark_ixion Registered Linux user: #516935 EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Geometric function example results @ 2011-07-01 18:19 Tom Lane <[email protected]> parent: Thom Brown <[email protected]> 1 sibling, 1 reply; 4+ messages in thread From: Tom Lane @ 2011-07-01 18:19 UTC (permalink / raw) To: Thom Brown <[email protected]>; +Cc: pgsql-docs Thom Brown <[email protected]> writes: > I noticed that there are no example outputs shown on the geometric > functions page (http://www.postgresql.org/docs/9.0/static/functions-geometry.html). > So I've attached a patch which adds them. I'm not entirely sure to > make of the 2 example outputs that are very large, but they're > included anyway. I think this is unworkable, because those tables are already so wide they barely fit on a page. This will certainly not work for PDF output, and I don't think it'll look very nice in HTML either. regards, tom lane ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Geometric function example results @ 2011-07-01 18:26 Thom Brown <[email protected]> parent: Tom Lane <[email protected]> 0 siblings, 0 replies; 4+ messages in thread From: Thom Brown @ 2011-07-01 18:26 UTC (permalink / raw) To: Tom Lane <[email protected]>; +Cc: pgsql-docs On 1 July 2011 19:19, Tom Lane <[email protected]> wrote: > Thom Brown <[email protected]> writes: >> I noticed that there are no example outputs shown on the geometric >> functions page (http://www.postgresql.org/docs/9.0/static/functions-geometry.html). >> So I've attached a patch which adds them. I'm not entirely sure to >> make of the 2 example outputs that are very large, but they're >> included anyway. > > I think this is unworkable, because those tables are already so wide > they barely fit on a page. This will certainly not work for PDF output, > and I don't think it'll look very nice in HTML either. Yeah, you're probably right. I didn't even think about the PDF representation, so I guess that's more than enough reason to leave out such examples. -- Thom Brown Twitter: @darkixion IRC (freenode): dark_ixion Registered Linux user: #516935 EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2011-07-01 18:26 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2011-06-23 12:09 Geometric function example results Thom Brown <[email protected]> 2011-06-27 14:31 ` Thom Brown <[email protected]> 2011-07-01 18:19 ` Tom Lane <[email protected]> 2011-07-01 18:26 ` Thom Brown <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox