building GDAL under cygwin with ODBC

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

building GDAL under cygwin with ODBC

Neil Best
Does anyone know if it's possible?

I said:

./configure --with-odbc=/usr/include/w32api

and then make throws a bunch of errors involving .h files in that directory.  If anyone has tried this I would appreciate hearing from you.

Would it be any different undr MinGW?  I have never worked with it so I don't know what to expect.  I just want to be able to wrap ogr2ogr in a bash script on a WinXP machine.

Thanks.


Neil
Reply | Threaded
Open this post in threaded view
|

Re: building GDAL under cygwin with ODBC

Neil Best

Neil Best wrote
Does anyone know if it's possible?

I said:  ./configure --with-odbc=/usr/include/w32api
It doesn't seem possible, so I am resigned to making it work in the FWTools DOS shell.  Is it possible to make a DSN-less ODBC connection?  In other words, can I specify my data source on the fly without having to go through the ODBC Administrator and setting up every single Access file as a DSN?  Something along the lines of:

ODBC:"Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\somepath\mydb.mdb;"

(Lifted from http://www.carlprothman.net/Default.aspx?tabid=90#ODBCDriverForAccess )

Otherwise I'll have to write something in Perl using Win32::ODBC to loop through all of my Access files and set up a DSN for each one.
Reply | Threaded
Open this post in threaded view
|

Re: building GDAL under cygwin with ODBC

Frank Warmerdam
Neil Best wrote:

>
>
> Neil Best wrote:
>> Does anyone know if it's possible?
>>
>> I said:  ./configure --with-odbc=/usr/include/w32api
>>
>
> It doesn't seem possible, so I am resigned to making it work in the FWTools
> DOS shell.  Is it possible to make a DSN-less ODBC connection?  In other
> words, can I specify my data source on the fly without having to go through
> the ODBC Administrator and setting up every single Access file as a DSN?
> Something along the lines of:
>
> ODBC:"Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\somepath\mydb.mdb;"
>
> (Lifted from
> http://www.carlprothman.net/Default.aspx?tabid=90#ODBCDriverForAccess )
>
> Otherwise I'll have to write something in Perl using Win32::ODBC to loop
> through all of my Access files and set up a DSN for each one.

Neil,

I have reviewed the current OGR ODBC driver and it does not seem to be
possible to pass in datasource names of the form you suggest though it is
vaguely possible that some appropriate magic quoting might get it to work.

I will say that the PGeo driver internally uses exactly this form to
access .mdb files through the same underlying ODBC machinery without
creating a DSN.  So at most the OGR ODBC driver would need some adjustments
to support it.

I will take a crack at this today, and if it I get it working I'll push out
a new FWTools release with the support.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: building GDAL under cygwin with ODBC

Frank Warmerdam
In reply to this post by Neil Best
Neil Best wrote:

>
>
> Neil Best wrote:
>> Does anyone know if it's possible?
>>
>> I said:  ./configure --with-odbc=/usr/include/w32api
>>
>
> It doesn't seem possible, so I am resigned to making it work in the FWTools
> DOS shell.  Is it possible to make a DSN-less ODBC connection?  In other
> words, can I specify my data source on the fly without having to go through
> the ODBC Administrator and setting up every single Access file as a DSN?
> Something along the lines of:
>
> ODBC:"Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\somepath\mydb.mdb;"
>
> (Lifted from
> http://www.carlprothman.net/Default.aspx?tabid=90#ODBCDriverForAccess )
>
> Otherwise I'll have to write something in Perl using Win32::ODBC to loop
> through all of my Access files and set up a DSN for each one.

Neil,

To my surprise, this syntax does work now though it is very fragile.
For instance, I did the following successfully:

   ogrinfo "ODBC:DRIVER=Microsoft Access Driver (*.mdb);DBQ=FWTest.mdb"

The danger is that the datasource name parser is looking for commas,
and colons for the general syntax:

userid/password@dsn,tablename(geometrycolname),...:srs_tablename(sridcolumn,srtextcolumn)

So it would be easy to end up with things getting confused and things
split up wrong if the "dsn" component is not a simple token.  I'm going
to see if I can make it more bulletproof.

But you should be able to get going already.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev