[FWTools] Converting directly a bunch of MapInfo tables into PostGIS

Richard Greenwood richard.greenwood at gmail.com
Mon Jun 29 22:01:41 EST 2009


On Mon, Jun 29, 2009 at 3:24 PM, Tahir Tamba<tahir54 at hotmail.com> wrote:
> Dear list,
>
> I have a bunch of MapInfo tables (.Tab) to upload to PostGIS server and I
> would like to use ogr2org command to do this in on step. Does this can be
> done using ogr2ogr command or do I need to right a script to export all the
> tables in PostGIS???

ogr2ogr will only do one TAB file at a time, so you would need to
write a simple shell script or batch file, maybe using a FOR loop.

> My second question is how to specify ogr command to to
> upload tables into a specific schema I've created??? For exemple I try this
> command and I got an error: ogr2ogr -f "PostgreSQL" PG:"host=myhost
> schema=myschema user=myusername dbname=mydb password=mypasswd" mydata.tab

You can specify the schema in the PostGIS layer name using the -nln option. e.g.
   -nln myschema.mytable

Regards,
-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com


More information about the FWTools mailing list