[gdal-dev] Trying to get ogr2ogr (and ogrinfo) to work with an ESRI Personal Geodatabase (.mdb) on Linux.

Chaitanya kumar CH chaitanya.ch at gmail.com
Thu Aug 27 16:52:09 EDT 2009


Mike,

The packages provided by the ubuntu repos may not be the latest. Despite the
fact that PGeo driver has been not as reliable on Linux as on Windows, it
might help if you installed the latest versions.

If you are willing to going through all this trouble, then you might as well
just compile the latest odbc library and then compile the gdal library
against it. Look at http://trac.osgeo.org/gdal/wiki/BuildingOnUnix and make
sure to use the option "--with-odbc=<path>" with the program ./configure .

On Fri, Aug 28, 2009 at 1:13 AM, Mike Hapner <mikehapner at yahoo.com> wrote:

> Short version:
> Trying to get ogr2ogr (and ogrinfo) to work with an ESRI Personal
> Geodatabase (.mdb) on Linux.
>
>
> -----------------------------------------------------------------------------------------------------------------------------------------
>
> I've done quite a bit of research and am pulling my hair out, so I'd love
> it if someone can point out the one or more thing(s) that I'm doing wrong.
>
> I've mainly been trying to get the scenario on this page to work:
> http://gdal.org/ogr/drv_pgeo.html
>
> I'm trying to push an ESRI Personal Geodatabase called geonames.mdb into a
> Postgres/PostGIS database.  I can do this fine with ogr2ogr on windows...but
> cannot for the life of me get it to work on Linux.  (For example -- in
> windows... ogr2ogr -f "PostgreSQL" PG:"host=192.168.23.23 user=someuser
> dbname=poi password=somepassword port=5432" S:\GISData\Geonames.mdb -a_srs
> EPSG:26986 works great)
>
> My environment:
> - Linux 2.6.28-14-server - Ubuntu 9.04(64bit)
> - Postgres/PostGIS
> - Installed the following packages with apt-get
>         unixodbc libmdbodbc gdal-bin mdbtools
> -- Note:  I installed gdal-bin to get the ogr utilities because I couldn't
> get FWTools installer to work....
>
>
> /etc/odbcinst.ini --- Note that the file in the driver line exists... and
> has read permissions
>   [Microsoft Access Driver (*.mdb)]
>   Description = MDB Tools ODBC drivers
>   Driver     = /usr/lib/libmdbodbc.so.0
>   Setup      =
>   FileUsage  = 1
>   CPTimeout  =
>   CPReuse    =
>
>
>
> ~/.odbc.ini
> [geonames]
> Description = Sample PGeo Database
> Driver      = Microsoft Access Driver (*.mdb)
> Database    = /mnt/data/gis/testgis/geonames.mdb
> Host        =
> Port        =
> User        =
> Password    =
> Trace       = Yes
> TraceFile   = /mnt/data/gis/testgis/odbc.log
>
>
>
> Things that work correctly:
> $mdb-tables -1 geonames.mdb    #  proves to me that mdbtools is properly
> installed and can see the tables inside the mdb file
> GDB_ReleaseInfo
> GDB_FeatureDataset
> GDB_ObjectClasses
> ...
> ...
> ...
>
> $ogrinfo abc123.shp       # proves to me that ogrinfo (from gdal-bin) is
> installed and can at least open a SHP file I had laying around
> INFO: Open of `abc123.shp'
>       using driver `ESRI Shapefile' successful.
> 1: abc123 (3D Point)
>
> $ogr2ogr -f "KML" abc123.kml abc123.shp  # This creates kml of the shp
> file... perfect.
>
>
> The problem is when I try to get it to open the geonames connection...
>
> --------------------------------------------------------------------------------------------------------------
> $ ogrinfo PGeo:geonames
> ERROR 1: PGeo: MDB Tools driver not found!
>
> ERROR 1: Unable to install MDB driver for ODBC!
>
> ERROR 1: PGeo: MDB Tools driver not found!
>
> ERROR 1: Unable to install MDB driver for ODBC!
>
> FAILURE:
> Unable to open datasource `PGeo:geonames' with the following drivers.
>
>
> ---------------------------------------------------------------------------------------------------------------
> $ ogr2ogr -f "KML" abc123.kml PGeo:geonames.mdb
> ERROR 1: PGeo: MDB Tools driver not found!
>
> ERROR 1: Unable to install MDB driver for ODBC!
>
>
> I know this is kinda long, but I didn't want to get yelled at for not doing
> my homework and not giving enough info... Looking forward to hearing back!
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



Best regards,
-- 
Chaitanya kumar CH.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090828/4bad5011/attachment.html


More information about the gdal-dev mailing list