[postgis-users] ESRI Shapes from database

Lee Keel lee.keel at uai.com
Wed Oct 17 07:28:04 PDT 2007


  _____  

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Obe,
Regina
Sent: Wednesday, October 17, 2007 7:42 AM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] ESRI Shapes from database

 

Lee,

 

Just wondering what your example bytea looks like that you are trying to
convert that is giving you problems.  Normally I would think what you are
doing below should work (and I have tried some simple examples and they work
- but I don't work with bytea so what do I know.)  

 

So perhaps whatever your bytea is returning is out of range of float and is
not actually what you think it is like you have a terminator byte in there
or something causing the problems.

 

Other thought is if you could get the string representation of your xcoord
without casting to float,  since in the next line your float is going to be
internally recast as a string to do this  sb := sb || '(' || xCoord || ' '
|| yCoord; 

anyway.

 

Hope that helps,

Regina

 

 

  _____  

Regina,

 

The reason that I can't go from the string representation is that the 8bytes
used from the bytea are an encoding that contain information about where to
place the decimal and the digits on both sides of the decimal.  So I need to
cast to a float, then back to a string to get the complete point.  I am very
curious as to the examples you got working.  Could you please post what you
had so I can take a look at what I am doing wrong.  Here is what I have, I
am just not sure how to take a hex string and convert it to float:

 

(encode(substring(esri_shape from cnt for 8), 'hex'))

 

 Thanks,

 Lee

 


  _____  

The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure pursuant to
Massachusetts law. It is intended solely for the addressee. If you received
this in error, please contact the sender and delete the material from any
computer. 

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20071017/a4edd78e/attachment.html>


More information about the postgis-users mailing list