[GRASS-user] batch conversion of ESRI to MapInfo

I have downloaded several sheets (approx 1600 files) from UK Ordnance
Survey open data web site in ESRI shapefile format and OS grid
references and now I need to convert them to MapInfo format and real
world co-ordinates.

I currently have available GRASS and Quantum GIS in linux and Mapinfo
4.1 & 5 running in windows emulation. Don't laugh, poverty dictates I
can't afford to update.

Does anyone know of a better solution than loading each shapefile into
QGIS then save as Mapinfo and keeping the OS grid ref.?

mik

What about using ogr2ogr?


<br>ogr2ogr -f "MapInfo File" mapinfo.tab input.shp<br>You have to write a script for batch conversion.<br>



— Στις Σάβ., 29/01/11, ο/η Mick bareman@tpg.com.au έγραψε:


> Από: Mick bareman@tpg.com.au
> Θέμα: [GRASS-user] batch conversion of ESRI to MapInfo
> Προς: “grass user” grass-user@lists.osgeo.org
> Ημερομηνία: Σάββατο, 29 Ιανουάριος 2011, 9:43
>
> I have downloaded several sheets (approx 1600 files) from UK Ordnance
> Survey open data web site in ESRI shapefile format and OS grid
> references and now I need to convert them to MapInfo format and real
> world co-ordinates.
>
> I currently have available GRASS and Quantum GIS in linux and Mapinfo
> 4.1 & 5 running in windows emulation. Don’t laugh, poverty dictates I
> can’t afford to update.
>
> Does anyone know of a better solution than loading each shapefile into
> QGIS then save as Mapinfo and keeping the OS grid ref.?
>
> mik
> _______________________________________________
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

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

On Sat, 2011-01-29 at 09:15 +0000, Leonidas Liakos wrote:

What about using ogr2ogr?
ogr2ogr -f "MapInfo File" mapinfo.tab input.shp
You have to write a script for batch conversion.

--- Στις Σάβ., 29/01/11, ο/η Mick <bareman@tpg.com.au> έγραψε:
        
        Από: Mick <bareman@tpg.com.au>
        Θέμα: [GRASS-user] batch conversion of ESRI to MapInfo
        Προς: "grass user" <grass-user@lists.osgeo.org>
        Ημερομηνία: Σάββατο, 29 Ιανουάριος 2011, 9:43
        
        I have downloaded several sheets (approx 1600 files) from UK
        Ordnance
        Survey open data web site in ESRI shapefile format and OS grid
        references and now I need to convert them to MapInfo format
        and real
        world co-ordinates.
        
        I currently have available GRASS and Quantum GIS in linux and
        Mapinfo
        4.1 & 5 running in windows emulation. Don't laugh, poverty
        dictates I
        can't afford to update.
        
        Does anyone know of a better solution than loading each
        shapefile into
        QGIS then save as Mapinfo and keeping the OS grid ref.?
        
        mik
        _______________________________________________
        grass-user mailing list
        grass-user@lists.osgeo.org
        http://lists.osgeo.org/mailman/listinfo/grass-user
        
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

> 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

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

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
>
>

On Sat, 29 Jan 2011 14:37:34 +0000
Saber Razmjooei <razmjooeis@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