Re: Convert bytea to Float8

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Lee Keel" <lee(dot)keel(at)uai(dot)com>
Cc: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Convert bytea to Float8
Date: 2007-10-16 01:21:53
Message-ID: b42b73150710151821r3c8028fn8e8abe8cd9fd8439@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/15/07, Lee Keel <lee(dot)keel(at)uai(dot)com> wrote:
> > -----Original Message-----
> > From: Scott Marlowe [mailto:scott(dot)marlowe(at)gmail(dot)com]
> > Sent: Monday, October 15, 2007 3:54 PM
> > To: Lee Keel
> > Cc: pgsql-general(at)postgresql(dot)org
> > Subject: Re: [GENERAL] Convert bytea to Float8
> >
> > Does something like:
> >
> > select encode('12346758'::bytea,'escape')::float
> >
> > work?
> >
> > Since I'm not sure what format your data is stored in I'm just guessing
> > here.
> >
> > Note that you could use get_byte and cycle through the offset to get
> > each byte as well.
>
> I am sorry to say that the following line did not work. I also tried the
> base64 and hex encoding types and got the same error.
> select encode(esri_shape::bytea,'escape')::float
>
> I got the following error:
> invalid input syntax for type double precision
>
>
> The data is an ESRI blob and I am trying to convert it to a WKB to store it
> in postgis. I was doing this in C# code, but I am getting a string memory
> error when I get into some of my large multi-polygons. So, my solution was
> to do all the byte parsing on the server. I know the standard way is to
> dump to shape file and import from there, but that is too much to ask of my
> client to do in this case.

This is sounding more and more like a question for the postgis lists.
why couldn't you load the shape file from the client side?

here is one link i found discussing loading WKB files:
http://osdir.com/ml/gis.postgis/2003-04/msg00067.html

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guy Rouillier 2007-10-16 02:25:01 Re: can I define own variables?
Previous Message Tom Lane 2007-10-15 22:59:17 Re: Problems inserting data into a table with a sequence