Simple Geomedia Warehouse to PostGIS exporter (pgFoundry Project Page)
The gm2pgsqlproject is a PostgreSQL Community project
that is a part of the pgFoundry.
This is a simple win32 command-line tool for exporting Geomedia(*) Warehouse
(mdb Access(**) database) to Postgres-Postgis SQL file. It works like the
The tools uses odb32lib to read mdb file and do not required
to install Microsoft Access(**); in some cases you must install
the free downloadable Access Runtime.
Download and Usage
You may download win32 executable or c++ source files at:
This is a command line (DOS) command, usage:
gm2pgsql [options] warefile.mdb outfile.sql db_schema_name SRID
options: -p : preserve case of names (tables and attributes)
where warefile.mdb is the source warehouse, outfile.sql is the
destination file, db_schema_name may be 'public' or another schema name,
SRID is the system reference code of PostGIS. The command generate a SQL file
suitable for insertion into a PostGIS/PostgreSQL database. Example:
gm2pgsql -p USSampleData.mdb USSampleData.sql us_schema 4326
- text feature are dumped as points plus a text field;
- oriented point are dumped as points (angle is deleted);
- no text code conversione are made (es. utf8 );
- geometry data are dumped as wkt (and not as wkb);
- arc geometry and rectangle are not supported;
- picklist and coord systems are not dumped;
- spatial key field, geometry field of texts and primary key field are inferred empirically.
Source File List and Building
The source file contains:
Building instruction with mingw: go to mingw directory and type make.
- blob4.h blob4.cpp : simple Geomedia(*) blob field codec;
- rodbc2.h rodbc2.inl rodbc2.cpp : simple odbc wrapper;
- gm2pgsql.cpp : main program;
- gm2pgsql_msvcc.mak Visual C++ makefile;
- mingw/makefile: mingw gcc makefile;
Contact me at email@example.com.
Claudio Rocchini. Istituto Geografico Militare. www.igmi.org
(*) Geomedia is (C) INTERGRAPH
(**) Access is (C) Microsoft