[postgis-users] ESRI Shapes from database
Lee Keel
lee.keel at uai.com
Fri Oct 19 12:27:00 PDT 2007
I have gotten things working under acceptable time constrains with C# by
writing to a file and using the COPY command. My new problem now is that I
have just figured out that the COPY command requires superuser permissions.
Does anyone know if there is any specific permission that I can grant to a
user to allow this instead of having to be superuser? This is a MAJOR
problem for me as my client is not very willing to give out superuser
passwords.
Thanks in advance for any help.
Lee Keel
_____
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Lee Keel
Sent: Thursday, October 18, 2007 10:47 AM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] ESRI Shapes from database
_____
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Obe,
Regina
Sent: Thursday, October 18, 2007 9:16 AM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] ESRI Shapes from database
Lee,
Okay now I think I understand the problem more clearly. I guess I should
have earlier from your description. Sadly I think you do have to do the
memcpy approach in C or similar thing in PLPerl or PLJava and then bind that
as a function. Unfortunately I know nothing about that stuff.
I think PLPerl ,PLJava, PLPython would be a little easier (granted slower)
since you can write the code directly in Postgresql. Then write something
like this
http://www.captain.at/howto-java-convert-binary-data.php
<http://www.captain.at/howto-java-convert-binary-data.php> but I'm not sure
if you would be allowed rights to create a new language on your PostgreSQL
server.
The problem is that the encode and decode functions are simply doing base
math between the two representations where as your bytea is storing the
physical bytes that define the double - precision (and the double precision
struct is not a straightforward byte to byte translation). To implement
this in PostgreSQL without direct access to the memory of the double
precision - I suspect you'd have to get deep into bitwise math to do some
pretty hairy stuff like described below for the double-precision 64 bit
which even if you get it right would be pretty slow if done in Pg. (e.g.
first bit for sign, next 11 bits for exponent, last 52 for fraction)
http://en.wikipedia.org/wiki/IEEE_floating-point_standard
<http://en.wikipedia.org/wiki/IEEE_floating-point_standard>
As far as your C# stuff goes, you said you used StringBuilder, have you
tried using StringWriter? I haven't myself so I'm speaking from a lofty
level of ignorance. I know StringWriter writes to a StringBuilder so would
seem more round about, but I wonder if it would get around your memory
problem since I think it behaves more like an IO Stream so maybe it writes
to a stringbuilder at the end.
Sorry I wasn't more helpful,
Regina
_____
[Lee Keel]
Regina,
You have been a tremendous help. I really appreciate all the extra time you
have taken. I am trying a few other approaches at this time. I did figure
out a workaround to my C# bug, but it is still WAY to slow. I am now trying
to use the COPY command and see if that will work for me.
Thanks again for all of your time!
Lee Keel
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/20071019/821107b5/attachment.html>
More information about the postgis-users
mailing list