[postgis] WKB from PostGIS over ODBC

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[postgis] WKB from PostGIS over ODBC

Erik Brenn
Hi all,

The PostgreSQL ODBC news group might be a better place for this but I wonder
if there are anyone out there who know if it should be possible to use a
Postgis function like this from an ODBC client:

select wkb_ndr(geom) where ...

>From the ODBC configuration settings I see that unknown types can be
transferred as LongVarchar.
Basically I would like to do the query above using ODBC direct or something
from Visual Basic, resulting in a byte array or something containing the wkb
streams. I recon it will be faster to use this method than parsing/writing
WKT strings on the client.

If this works I plan to write some AutoCad Map VBA classes that read and
write GIS data from a PostgreSQL system.

Any comments?

regards,
Erik Brenn
Senior consultant
Blom International




_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Secure your servers with 128-bit SSL encryption! Grab your copy of
VeriSign's FREE Guide "Securing Your Web Site for Business." Get it now!
http://www.verisign.com/cgi-bin/go.cgi?a=n094442340008000
http://us.click.yahoo.com/6lIgYB/IWxCAA/yigFAA/PhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[hidden email]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



Reply | Threaded
Open this post in threaded view
|

Re: [postgis] WKB from PostGIS over ODBC

Paul Ramsey-2
> If this works I plan to write some AutoCad Map VBA classes that read and
> write GIS data from a PostgreSQL system.

Very cool idea Erik... that would be our first piece of interactive GIS
software using PostGIS as a backend...

> The PostgreSQL ODBC news group might be a better place for this but I wonder
> if there are anyone out there who know if it should be possible to use a
> Postgis function like this from an ODBC client:
>
> select wkb_ndr(geom) where ...
>
> From the ODBC configuration settings I see that unknown types can be
> transferred as LongVarchar.

Our experience has been this (in C, not in ODBC): You can treat the long
varchar as a byte array, just ignore that they are characters and read
their 8bit encodings. However, we have found that the ODBC driver for
pgsql limits the size of things it will put into these structures. Even
passing them back as simple WKT strings, the ODBC driver will truncate
them at a fixed size (the default is 1024 bytes I think). You can up the
truncation limit in the driver configuration, however, but I do not
think there is a way to turn off the truncation behavior entirely.

> Basically I would like to do the query above using ODBC direct or something
> from Visual Basic, resulting in a byte array or something containing the wkb
> streams. I recon it will be faster to use this method than parsing/writing
> WKT strings on the client.

That is our guess as well. Certainly Dave's early work with the native
Mapserver mode indicates that we can be blazingly fast reading out of
WKB.

To unsubscribe from this group, send an email to:
[hidden email]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/