[Gdal-dev] MIF/MID problem

Todd.Southen at bentley.com Todd.Southen at bentley.com
Thu Jan 26 14:17:30 EST 2006


I've attached some tiny files and have included their contents as text
below.

Here's the output from ogrinfo for these files, if you look at the BLOCK
attribute it is incorrect:

C:\temp\mif>ogrinfo small.mif small
Had to open data source read-only.
INFO: Open of `small.mif'
using driver `MapInfo File' successful.

Layer name: small
Geometry: Unknown (any)
Feature Count: 2
Extent: (407128.974000, 155312.559000) - (407142.741000, 155329.616000)
Layer SRS WKT:
LOCAL_CS["Nonearth",
    UNIT["Meter",1]]
NAME: String (50.0)
BLOCK: Integer (0.0)
OWNER: String (64.0)
APPRAISED_VALUE: Real (0.0)
TAXES: Real (0.0)
FLOODZONE: Integer (0.0)
NUM: String (254.0)
OGRFeature(small):1
  NAME (String) =  S. 11th St.
  BLOCK (Integer) = 0
  OWNER (String) = 4
  APPRAISED_VALUE (Real) = 0
  TAXES (Real) = 0
  FLOODZONE (Integer) = 0
  NUM (String) = 56115.58
  Style =
BRUSH(fc:#000000,bc:#ffffff,id:"mapinfo-brush-1.ogr-brush-1");PEN(w:1px,
c:#000000,id:"mapinfo-pen-2.ogr-pen-0")
  POLYGON ((407131.72100000002 155322.44099999999,407134.46799999999
155329.61600000001,407142.74099999998 155327.242,407141.50300000003
155322.467,40
7140.875 155320.049,407131.72100000002 155322.44099999999))

OGRFeature(small):2
  NAME (String) =  S. 11th St.
  BLOCK (Integer) = 0
  OWNER (String) = 4
  APPRAISED_VALUE (Real) = 0
  TAXES (Real) = 0
  FLOODZONE (Integer) = 0
  NUM (String) = 62480.53
  Style =
BRUSH(fc:#000000,bc:#ffffff,id:"mapinfo-brush-1.ogr-brush-1");PEN(w:1px,
c:#000000,id:"mapinfo-pen-2.ogr-pen-0")
  POLYGON ((407128.97399999999 155315.266,407131.72100000002
155322.44099999999,407140.875 155320.049,407139.55200000003
155314.94899999999,407138.931
99999997 155312.55900000001,407128.97399999999 155315.266))

SMALL.MIF

Version 300
Charset "WindowsLatin1"
Delimiter ", "
CoordSys Nonearth Units "M" Bounds (406547, 153897) (407967, 155532)
Columns 7
  NAME Char (50)
  BLOCK Integer
  OWNER Char (64)
  APPRAISED_VALUE Float
  TAXES Float
  FLOODZONE Integer
  NUM Char (254)

Data
Region 1
6
407131.721 155322.441
407134.468 155329.616
407142.741 155327.242
407141.503 155322.467
407140.875 155320.049
407131.721 155322.441
Brush (1, 0, 16777215)
Pen (1, 2, 0)
Region 1
6
407128.974 155315.266
407131.721 155322.441
407140.875 155320.049
407139.552 155314.949
407138.932 155312.559
407128.974 155315.266
Brush (1, 0, 16777215)
Pen (1, 2, 0)

SMALL.MID

" S. 11th St.", 4, "Shiffer James A and Martha L", 56115.58, 637.68, 10,
"230"
" S. 11th St.", 4, "Guarino Sandra", 62480.53, 710.01, 10, "232" 

-----Original Message-----
From: Daniel Morissette [mailto:dmorissette at dmsolutions.ca] 
Sent: Thursday, January 26, 2006 2:06 PM
To: Todd Southen - Consultant
Cc: gdal-dev at lists.maptools.org
Subject: Re: [Gdal-dev] MIF/MID problem

Todd.Southen at bentley.com wrote:
> Hello all,
> 
> I'm having problems reading a MID file with OGR.  It appears that it 
> doesn't like my data as there are spaces after the commas (even though

> the delimiter is properly set as ", " in the MIF header).  If I change

> the delimiter entry in the MIF to "," from ", " then things work fine.
> Does OGR not like multicharacter delimiters?
> 
> For what its worth, these same files load just fine in MapInfo.
> 

I did a quick test with the MITAB library's test programs (MITAB what
OGR uses to read MIF files) and it worked fine with the following MID
records:

42, 123.45, ""
100, "100.5", "12345678901234567890"
100, "100.5", "12345678901234567890"
100, "100.5", "12345678901234567890"

Can you please provide a test file that reproduces the problem?

Daniel
--
------------------------------------------------------------
  Daniel Morissette               dmorissette at dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: small.mif
Type: application/octet-stream
Size: 654 bytes
Desc: small.mif
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20060126/536ca16a/small.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: small.mid
Type: audio/mid
Size: 146 bytes
Desc: small.mid
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20060126/536ca16a/small.bin


More information about the Gdal-dev mailing list