From: | Andreas Erber <post(at)andreas-erber(dot)net> |
---|---|
To: | James William Pye <pgsql(at)jwp(dot)name> |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: BUG #2240: length() with geometric types |
Date: | 2006-02-07 14:02:23 |
Message-ID: | 43E8A86F.8050506@andreas-erber.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
sorry to bug you with that. I figured that out, too, in the meantime. I
wonder why the default behaviour of the path-constructor to end up in a
closed path. I would intentionally expect an open path - since I
understand a path as a connection of points that go from a start to a
destination and not necessarily back. If I would like to have a closed
path I would probably use the polygon datatype.
What was the intenion behind some of the geometric datatypes anyway. I
would have liked to work with them (esp. path) but they turned out not
to be very useful. (I cannot append or prepend a point to a path, I
cannot index-access it, I didn't even find a way to cast it to a string).
Is there any further development planned or will you keep this status? I
would prefer to see these datatypes handier in the future so they
probably get more useful.
Thx
CU
ae
James William Pye schrieb:
> On Mon, Feb 06, 2006 at 02:41:39PM +0000, Andreas Erber wrote:
>> Hi,
>>
>> I discovered some strange behaviour:
>> The length() function returns different results depending on the geometric
>> data type used as argument.
>>
>> length(lseg) produces the correct result, i.e. length(lseg('(0,0),(2,0)')) =
>> 2
>>
>> length(path) always produces the double result (independently from the
>> length of the path), i.e.
>> length(path('(0,0),(2,0)')) = 4
>> length(path('(0,0),(2,0),(4,0),(6,0),(8,0)')) = 16
>>
>> Is it supposed to be that way? If yes, why?
>
> Yes.
>
> You specified your path as a closed path. With its "loopback", it's twice as
> long.
>
> To specify it as an open path, do path('[(0,0),(2,0)]').
>
> SELECT length(path('[(1,0),(0,0)]')) = '1';
> SELECT length(path('(1,0),(0,0)')) = '2';
- --
- ------------------------------------------------------
Information is a weapon of mass destruction
[Faithless]
- ------------------------------------------------------
Andreas Erber
Berlin
Germany
- ----------------------------------------------------
e-mail post(at)andreas-erber(dot)net
home http://www.andreas-erber.net
- ----------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFD6KhuBzgniz6LxFMRArrzAJ49GKPSOqB+S3ifW/RRzCEPjvMFOQCeMJjn
AJX3rHfm+YEzEcfJv5epuf4=
=6+08
-----END PGP SIGNATURE-----
Attachment | Content-Type | Size |
---|---|---|
post.vcf | text/x-vcard | 270 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-02-07 14:37:49 | Re: BUG #2245: pg_dump doesn't dump expressions with sequence in DEFAULT setting for some column in table |
Previous Message | Nikolay Samokhvalov | 2006-02-07 12:35:50 | BUG #2245: pg_dump doesn't dump expressions with sequence in DEFAULT setting for some column in table |