[postgis-users] Problem in Conversion from MapInfo to PostGIS using ogr2ogr

Brent Wood pcreso at pcreso.com
Sat Feb 24 10:26:38 PST 2007


An alternative approach:

Try using ogr2ogr to create shapefiles, as an intermediate format, then
shp2pgsql to create a loading script for PostGIS, which should be able to
create the new table. 

This is easily wrapped up in a cygwin script, or batch file, to make running
the sequence easier.

eg:

ogr2ogr <mapinfo to shape>
shp2pgsql <shape to sql> > run.sql
psql db -f run.sql



Cheers,

  Brent Wood





--- Richard Greenwood <richard.greenwood at gmail.com> wrote:

> On 2/24/07, Mahtab Alam <cadxing at gmail.com> wrote:
> > Hi,
> > I am having problem loading Mapinfo Tab to PostGIS using ogr2ogr.
> >
> > C:\Program Files\FWTools1.1.3>ogr2ogr -f postgresql PG:dbname=gisdb
> > D:\Temp\test.tab
> > ERROR 1: PQconnectdb failed.
> > could not create socket: Address family not supported (0x0000273F/10047)
> >
> > ERROR 1: PostgreSQL driver doesn't currently support database creation.
> > Please create database with the `createdb' command.
> > postgresql driver failed to create PG:dbname=gisdb
> >
> > Regards
> >
> > Mahtab
> 
> I was never able to get ogr2ogr to create a new table on windows,
> however it can create a new table on OS X and Linux, and it can load
> data into an existing table on windows. Try creating the target table
> first, maybe with shp2psql, then use ogr2ogr to load the MapInfo data.
> 
> Rich
> 
> 
> -- 
> Richard Greenwood
> richard.greenwood at gmail.com
> www.greenwoodmap.com
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 




More information about the postgis-users mailing list