[GRASS-user] Re: batch conversion of ESRI to MapInfo

Mick bareman at tpg.com.au
Sun Jan 30 01:23:50 EST 2011


On Sat, 29 Jan 2011 14:37:34 +0000
Saber Razmjooei <razmjooeis at faunalia.co.uk> wrote:

> 
> On Sat, 2011-01-29 at 12:48 +0100, Hermann Peifer wrote:
> > > ogr2ogr -f "MapInfo File" mapinfo/$file.tab $file
> > 
> > You could cut away the "shp" suffix like this:
> > ogr2ogr -f "MapInfo File" mapinfo/${file%shp}tab $file
> indeed! 
> cheers
> Sab
> > 
> > I am not fully sure what "real world co-ordinates" means, but this 
> > additional switch might do what you expect:
> > 
> > -t_srs epsg:4326
> > 
> > Hermann
> > 
> > On 29/01/2011 10:53, Saber Razmjooei wrote:
> > > Mik
> > >
> > > As suggested, better to use ogr2ogr.
> > > if you use linux:
> > > 1- Create an empty text file in the folder where your shapefiles
> > > are located
> > > 2- Open the text file and copy paste these:
> > >
> > > mkdir ./mapinfo
> > > for file in *.shp
> > > do
> > >    ogr2ogr -f "MapInfo File" mapinfo/$file.tab $file
> > > done
> > >
> > > 3-save the file as convert.sh
> > > 4- from the terminal, run convert.sh
> > > 	$ cd /PATH/TO/SHAPEFILES/
> > > 	$ sh convert.sh
> > > 5- all your mapinfo files should appear under mapinfo folder.
> > >
> > > Cheers
> > > Sab
> > >
> > >
Many many thanks to those who offered their help, after most of the day
relearning a small chunk of bashing I now have my data converted.

mick


More information about the grass-user mailing list