# How to import an Access database to GeoDjango?

I'm a I've just inherited a pile of institutional geodata that's stored in an MS Access database. I need to pull that data out into a format that I can work with in GeoDjango--so I'm OK with shapefiles or exporting it directly to a more useful database (mysql or postgres). What's the best way to do that? I'm a GIS newb, so I'm hoping there's an easy solution here.

I can get access to an ArcGIS install to work with the data if necessary.

-
Does the MS Access data contain the spatial information, or are these just attributes related to the spatial data? –  djq Nov 8 '11 at 21:53
@celenius The database contains spacial data--there is a long binary column in each table called "shape", I believe. –  Michael C. O'Connor Nov 8 '11 at 22:00
Do you know what software created the Access DB? If you open MS Access, are there a bunch of "GDB_" Tables? This likely means it is an ESRI Geodatabase. More than likely its ESRI, but Geomedia (and likely others) also use MS Access to store spatial data. If you find a GDB_ReleaseInfo table, open it and the "Minor" field should tell you which 9.x GDB version it is. If GDB_ReleaseInfo is missing, it is likely a 10.x GDB. –  RyanDalton Nov 8 '11 at 22:31
@RyanDalton My understanding is that the data was generated in ArcGIS, and there are a bunch of GDB_* tables. I don't see GDB_ReleaseInfo, but there is a GDB_Release table with one row (Major,Minor,Bugfix):(1,1,0). –  Michael C. O'Connor Nov 8 '11 at 22:45
It likely means then that it is an ESRI 8.1 geodatabase. That should help others in suggesting appropriate solutions. –  RyanDalton Nov 8 '11 at 22:50

You could probably migrate your data out of the Personal Geodatabase and directly into PostGIS using ogr2ogr, which supports both Personal Geodatabase and PostGIS file formats.

-

I am about to play around with GeoKettle http://www.spatialytics.org/projects/geokettle/ this perfoms ETL on various datasets, the data I have is in CSV, so I would imagine that if Geokettle does not natively support Access you can dump it to csv.

-

As Ryan Dalton said you can use OGR2OGR. The FWTools binaries for windows seem to have ESRI Personal Geodatabase support built in. You can easily export data using the following command:

ogr2ogr -f "PostgreSQL" PG:"host=localhost user=someuser dbname=somedb password=somepassword port=5432" C:\GISData\Geonames.mdb -a_srs EPSG:26986


CREDITS: the above information has been taken from bostongis.com, scroll down to 'ESRI GeoDatabase (MDB format)' for the relevant section.

-