Opened 11 years ago

Closed 8 years ago

#5253 closed defect (fixed)

ogr2ogr shape to "MapInfo file" don't convert decimal field

Reported by: BenC Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: 1.9.1
Severity: normal Keywords: mitab
Cc: Daniel Morissette

Description

Hi,

Qgis' user, I'm a very beginer with Gdal, but somebody from Qgis hub told me to post here.. I'll try to explain my problem.

I have a problem when I convert some shape layers to MapInfo tab layers with ogr2ogr.

I tested it on windows 7 with Gdal 1.9 and Mapinfo 7.8 / 11.

I convert Layer_Cadastre.shp to .tab -see attached files. MapInfo is not able to read it and closes immediately. But Qgis can read the .tab converted file without closing. I thought it cames from decimal field. Indeed, I have these problems when they are decimal field in shape layers.

If I change .tab file in notepad and replace "Decimal field" by Float, it works :

    !table
    !version 300
    !charset Neutral

    Definition Table
    Type NATIVE Charset "Neutral"
    Fields 1
    F_DECIMAL Decimal (24,15) ;

replaced by

    !table
    !version 300
    !charset WindowsLatin1

    Definition Table
    Type NATIVE Charset "WindowsLatin1"
    Fields 1
    F_DECIMAL Float ;

Then MapInfo is able to read it.

But I try an other time with a simple shape layer made in Qgis (layer1 -see attached files) wich have decimal field, I converted it, and MapInfo read it.

I don't understand where the problem comes from. I hope this will help somebody to fix it.

Attachments (1)

Pb conversion Mapinfo.zip (7.9 KB ) - added by BenC 11 years ago.

Download all attachments as: .zip

Change History (8)

by BenC, 11 years ago

Attachment: Pb conversion Mapinfo.zip added

comment:1 by Even Rouault, 11 years ago

Cc: Daniel Morissette added

Looks very much related to #3853

comment:2 by Jukka Rahkonen, 9 years ago

The related #3853 is now marked as fixed. Is this issue fixed by the same?

comment:3 by Even Rouault, 9 years ago

No, #3853 was for .mif/.mid. This issue is about .tab

comment:4 by Daniel Morissette, 9 years ago

I found the following at https://groups.google.com/forum/#!topic/mapinfo-l/XZolR8L7-zY

Peter Horsbøll Møller 	

May 1

Found this in the MapBasic Help System under Create Table:

columntype is the data type associated with the column. Each columntype is defined as follows:

Char( width ) | Float | Integer | SmallInt | 
	Decimal( width, decplaces ) | Date | DateTime | Time | Logical

Where Decimal width is from 1 to 20, and Decimal decplaces from 0 to 16. The decplaces setting must either be zero (0) or 2 less than width; if width is 10, decplaces can be up to 8.

Peter Horsbøll Møller
Pitney Bowes Software

Sounde like we may need to enforce this limit of (20, 16) on Decimal field size in the TAB writer, after testing to confirm that this limit is indeed the source of the issue of course.

comment:5 by Jukka Rahkonen, 9 years ago

Keywords: mitab added

comment:6 by Jukka Rahkonen, 8 years ago

Even has set the limit of (20, 16) see #6392. Hoping that it resolved also this issue (no MapInfo available for testing).

comment:7 by Jukka Rahkonen, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.