[Qgis-user] mdb and QGIS in Ubuntu 12.04 with UbuntuGis

Jesús Francisco jgomo3 at gmail.com
Thu Jun 7 15:22:00 PDT 2012


2012/6/6 Lee Hachadoorian <Lee.Hachadoorian+L at gmail.com>:
>> On Tue, 2012-06-05 at 09:42 -0430, Jesús Francisco wrote:
>>> Hello,
>>>
>>> I'm working with QGIS 1.7.4[*] in Ubuntu 12.04 installed from the
>>> UbuntuGis repository[1]. Also, i need to work with an .mdb file made
>>> by a colleague with ArcGis.
>>>
>>> I seems that QGIS is able to work with .mdb files [2], [3] in Windows.
>>> I don't find the link, but i readed that in Linux it was needed
>>> mdbtools, or and/or LibreOffice Base.
>>>
>>> The point is that there is people able to work with QGIS in Ubuntu and
>>> .mdb files, but i can't. What am i missing?
>>>
>>> Thank you!
>>>
>>> [1] https://launchpad.net/~ubuntugis
>>> [2] http://lists.osgeo.org/pipermail/qgis-user/2010-March/008001.html
>>> [3] http://gis.stackexchange.com/a/20725/4599
>>>
>>> [*] Compiled agints: GDAL/OGR:1.7.3, PostgreSQL:9.1.3, SpatiaLite:
>>> 2.4.0, QWT: 5.2.2, QT: 4.8.1.
>
> This has been bugging me for a while, and I've just been using QGIS on
> Windows when necessary, but since it came up…
>
> First, Jesús, what you are missing is that there are additional hoops
> you have to jump through to get this to work on Linux. On Windows, you
> can add a Personal Geodatabase the same way you add a shapefile, KML
> file, etc., just choose "ESRI Personal Geodatabase" in the file list
> (reference [3]). On Linux, you must set up an ODBC source first, using
> MDBTools or Jackcess. See:
>
> http://www.gdal.org/ogr/drv_pgeo.html
> http://www.gdal.org/ogr/drv_mdb.html
>

Thank you Lee. I followed your instructions, and set up an ODBC source
using MDBTools ...

> For the rest of the list:
>
> Using the MDBTools-based driver, I still can't get this to work, and I
> haven't found any instructions for how QGIS is supposed to connect to
> a Personal Geodatabase on Linux. I set up a DSN in ~/odbc.ini.
>
> $ ogrinfo PGeo:world_pgeo
> ERROR 1: importFromWKT() failed on SRS 'GEOGCS["GCS_'.
> ERROR 1: importFromWKT() failed on SRS 'GEOGCS["GCS_'.
> ERROR 1: importFromWKT() failed on SRS 'GEOGCS["GCS_'.
> ERROR 1: importFromWKT() failed on SRS 'GEOGCS["GCS_'.
> ERROR 1: importFromWKT() failed on SRS 'GEOGCS["GCS_'.
> ERROR 1: importFromWKT() failed on SRS 'GEOGCS["GCS_'.
> INFO: Open of `PGeo:world_pgeo'
>      using driver `PGeo' successful.
> 1: country
> 2: lakes
> 3: latlong
> 4: rivers
> 5: world30
> 6: cities
>

When i do the command, i got:

$  ogrinfo PGeo:sample_pgeo

ERROR 1: PGeo: MDB Tools driver not found!

Warning 1: Unable to install MDB driver for ODBC, MDB access may not supported.

Warning 1: SRID 0 lookup failed.
# this warning repeat 40 times.
# then ...

INFO: Open of `PGeo:sample_pgeo'
      using driver `PGeo' successful.
1: gas_m_r
2: Estac_Serv
3: estac_pub
4: Cines
5: Ferreterias
# ...
45: Parcelamientos_2009
46: Edificaciones_2009

> So, it seems OGR is opening the database, but is not able to interpret
> the data spatially?
>

Same question. Although the errors are different for me.

> Assuming this *were* working, how do you add the data in QGIS? Since
> ESRI Personal Geodatabase does not appear in the list of formats if
> you attempt to add the data as a file, I tried:
>
> 1. Add Vector Layer
> 2. Choose Source type = Database
> Question: Why doesn't QGIS find the existing DSN?
> 3. Under Connections, hit New
> 4. Type: Should this be ODBC or ESRI Personal Geodatabase?
> 5. Name = world_pgeo (DSN assigned in ~/odbc.ini). Leave all the other

Mine is sample_pgeo

> fields blank. Hit OK

Here i hit Test Connection and it works.

> 6. Back in Add Vector Layer dialog, make sure Database Type = ESRI
> Personal Geodatabase, hit Open.

I tried all this way down, but here i'm unable to open the database.
QGis complains that i didn't selected any database. What i can see in
the Vector Layer dialog is that the Connection list is empty, but if i
try to Add or Edit the connections, when i name it sample_pgeo it ask
me if i want to overwrite the existing connection.

> 7. At password prompt, just hit OK (there is no password).
> 8. List of layers appears. Select desired layers and add.
> Result: Layers appear, attribute table can be opened, but there is no
> geometry data and nothing appears on the map canvas. Also, in
> attribute table, first row shows "ERROR" as each cell value.
>
> Alternatively, set Database Type = ODBC, and MSysObjects gets added to
> the Layers.
>
> Oddly, the name of the DSN doesn't seem to matter. I'm only testing
> with one DSN, but if I create a connection named "random", I still see
> the list of layers in my test geodatabase (World.mdb), and they still
> get added without geometry data.
>

I could verify the name doesn't matter with the test connection in the
connection creationg dialog.

> Has anyone had success with this? Am I attempting to add the data in
> the correct way in QGIS?
>

So here we are... Thanks in advise with any Help.

Jesús.

> Thanks,
> --Lee
>
> --
> Lee Hachadoorian
> PhD, Earth & Environmental Sciences (Geography)
> Research Associate, CUNY Center for Urban Research
> http://freecity.commons.gc.cuny.edu/



More information about the Qgis-user mailing list