2

We're migrating from Mapinfo to GIS + PostGIS. I have a file questions about file conversion:

  1. Is there any difference between importing directly from tab to PostGIS, compared with converting tab-shapefile-PostGIS? Do either approaches have accuracy issues? We have hundreds of tab files and there is a mix of lat/long and UTM projections.

  2. What's the best way of converting multiple tab files to PostGIS at once? This is my (poor) attempt at using ogr2ogr:

for %f in (*.tab) ogr2ogr -f "PostgreSQL" PG:"host=myhost user=myloginname dbname=mydbname password=mypassword".

I do have the PostGIS shapefile and DBF loader installed but it only works for shapefiles.

3
  • Don't use interim shapefiles. Direct conversion will give less trouble because shapefiles have restrictions which do not affect PostGIS. Doesn't your ogr2ogr command work?
    – user30184
    Commented Feb 23, 2017 at 8:19
  • No the ogr2ogr command above doesn't work, the error is 'Unable to open datasource `in' with the following drivers.'
    – Bill
    Commented Mar 8, 2017 at 5:04
  • That's because your FOR command has wrong syntax. I do not use that often but I suppose you can find help from the net. Adding "do" and %f as an input for ogr2ogr might help microsoft.com/resources/documentation/windows/xp/all/proddocs/…
    – user30184
    Commented Mar 8, 2017 at 8:17

1 Answer 1

0

You know what? You should use FME to do this. You'll be able to do it using a free trial version, and it'll simplify the whole process for you. You could also do a bunch of data cleansing on the way.

Some thoughts to be aware of:

  • MapInfo files have mixed geometry in them (points, lines, polygons). While you can load this into PostGIS, it's pretty normal to have only one geometry type per table. (QGIS, for example, can't load a mixed table all at once)
  • Using FME you'll be able to transform all the files to one CRS too, which is nice

If you're intending on continuing to use MapInfo, you probably should load them using MapInfo itself, as then it handles the metadata and style transfers too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.