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

Lee Hachadoorian Lee.Hachadoorian+L at gmail.com
Wed Jun 6 12:05:44 PDT 2012


> 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

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

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

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
fields blank. Hit OK
6. Back in Add Vector Layer dialog, make sure Database Type = ESRI
Personal Geodatabase, hit Open.
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.

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

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