[postgis-users] convert tracking point from ms access to postgis

Markus Schaber schabi at logix-tt.com
Mon Aug 7 08:00:53 PDT 2006


Hi, Kurt,

K Kuo wrote:

> I got a problem while converting a tracking point MS Access file to
> PostGIS. Please give me some suggestions. Thanks.
> The Access file has 4 attributes: ID, Time, Latitude and Longitude. I
> tried to use shp2pgsql command. Therefore, I convert access file to
> dbase in order to create a shapefile using ArcGIS. However, dbase does
> not take access date/time format. The date/time format in access is
> mm/dd/yyyy hh:mm:ss. After conversion, the time attribute in dbase file
> only shows mm/dd/yyyy. Is there any way to fix this problem or other way
> to convert access file into PostGIS directly.

Try to export it as CSV / TSV file (comma / tab separated values), and
then use the psql COPY command with appropriate options to import your data.

You will first have to import it as a 4-column table, and then use
MakePoint() to create Point geometries.

Alternatively, you can write a small perl/python/ruby/$whatever script
that pulls the data out of the access database (or the CSV/TSV file),
and generates the appropriate PostgreSQL dump file (or inserts into
PostgreSQL directly).

HTH,
Markus




-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org



More information about the postgis-users mailing list