Re: Unpack an org.postgresql.geometric.PGpoint - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Unpack an org.postgresql.geometric.PGpoint
Date
Msg-id alpine.BSO.2.03.1307242316080.12784@ejurka.com
Whole thread Raw
In response to Unpack an org.postgresql.geometric.PGpoint  (Sven Holcombe <sven.holcombe@gmail.com>)
List pgsql-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

pgsql-jdbc by date:

Previous
From: dmp
Date:
Subject: Re: Website Redo Kick Off
Next
From: Kris Jurka
Date:
Subject: Re: Website Redo Kick Off