From: Kris Jurka <books@ejurka.com>
To: Sven Holcombe <sven.holcombe@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Unpack an org.postgresql.geometric.PGpoint
Date: Wed, 24 Jul 2013 23:18:15 -0400 (EDT)
Message-ID: <alpine.BSO.2.03.1307242316080.12784@ejurka.com> (raw)
In-Reply-To: <CADmUhuy2484iQrUEgBOraL9tz4nBUPtCN41OyFDua+bhpOS61g@mail.gmail.com>
References: <CADmUhuy2484iQrUEgBOraL9tz4nBUPtCN41OyFDua+bhpOS61g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
On Tue, 23 Jul 2013, Sven Holcombe wrote:
> I can get an org.postgresql.util.PGobject object into my application
> (MATLAB) via a database connection:
> D = fetch(conn,'SELECT ST_GeomFromText(''POINT(-10 5)'')')
> class(D{1}) % Returns 'org.postgresql.util.PGobject'
> D{1}.getValue % Returns the java.lang.String
> '010100000000000000000024C00000000000001440'
>
> But I want to unpack this object to get at its contents (ie, the coordinates
> -10 and 5). Can someone describe how to do this?
>
This is returning a postgis geometry option, not the builtin postgresql
point data type. To access geometry objects you need to use the postgis
java wrapper:
http://postgis.net/docs/manual-2.0/ch06.html#id351597
Kris Jurka
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: books@ejurka.com, sven.holcombe@gmail.com
Subject: Re: Unpack an org.postgresql.geometric.PGpoint
In-Reply-To: <alpine.BSO.2.03.1307242316080.12784@ejurka.com>
References: <CADmUhuy2484iQrUEgBOraL9tz4nBUPtCN41OyFDua+bhpOS61g@mail.gmail.com> <alpine.BSO.2.03.1307242316080.12784@ejurka.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox