[FWTools] mif to shape conversion, ogr2ogr not recognizing mif file

Daniel Morissette dmorissette at mapgears.com
Mon Jul 19 12:57:13 EST 2010


The MIF driver expects the DATA statement to be at the beginning of the
line. This is also the case of several other keywords, such as the POINT
keyword for instance, and this is the way MapInfo produces its files.

If you change your MIF file to remove the spaces before the DATA and
POINT keywords then it works:

Version 3
Delimiter ","
INDEX 3
Coordsys Earth Projection 1,104
Columns 14
   Lon Decimal (11,6)
   Lat Decimal (10,6)
   Dep Decimal(7,1)
   Src_ID CHAR(8)
   Snd_datum CHAR(5)
   HYSAS_Src_ID CHAR(7)
   Eval Smallint
   Class CHAR(1)
   Adj CHAR(1)
   Surv CHAR(1)
   Trk CHAR(1)
   WG84 CHAR(1)
   Updated DATE
   Point_Type CHAR(1)
Data
Point  -113.793621   20.506910
     SYMBOL (49,16711680,6)



cruiserad at comcast.net wrote:
> attempting to convert mif/mid point geometry, WGS84 DDcoordinate system
> to shapefile format.
> 
> using this comad string,
> |ogr2ogr -f "ESRI Shapefile" mydata.shp mydata.mif
> 
> I get this error msg
> |error 6: data keyword not found in mydata.mif  file may be corrupt.
> 
> failure:
> unable to open data source with the following drivers.
> (list of drivers)
> 
> here's the mif headder,
> Version 3
> Delimiter ","
> INDEX 3
> Coordsys Earth Projection 1,104
> Columns 14
>    Lon Decimal (11,6)
>    Lat Decimal (10,6)
>    Dep Decimal(7,1)
>    Src_ID CHAR(8)
>    Snd_datum CHAR(5)
>    HYSAS_Src_ID CHAR(7)
>    Eval Smallint
>    Class CHAR(1)
>    Adj CHAR(1)
>    Surv CHAR(1)
>    Trk CHAR(1)
>    WG84 CHAR(1)
>    Updated DATE
>    Point_Type CHAR(1)
>    Data
>    Point  -113.793621   20.506910
>      SYMBOL (49,16711680,6)
> 
> these mif/mid are the output of another conversion program
> 
> any help appeciated
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> FWTools mailing list
> FWTools at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/fwtools
> http://fwtools.maptools.org/


-- 
Daniel Morissette
http://www.mapgears.com/


More information about the FWTools mailing list