[gdal-dev] Data types change converting from MID/MIF to SHP

Zoltan Szecsei zoltans at geograph.co.za
Wed Nov 24 10:41:06 EST 2010


On 2010-11-24 16:12, Frank Warmerdam wrote:
> Zoltan Szecsei wrote:
>> Hi,
>> Here's a strange one that hopefully can be overcome quickly.
>>
>> I'd be grateful for any assistance with this problem.
>>
>> Kind regards,
>> Zoltan
>>
>>
>>
>> I have a MID/MIF file combination with:
>>
>> COLUMNS 5
>>     FEAT_TYPE_ integer (5)
>>     GID integer (10)
>>     ENTITY_NAM char (50)
>>     GEOMETRY_T char (5)
>>     AUD_MOD char (5)
>> DATA
>>
>> yet as a SHP file, the two Integer fields become Real 11.0 - yes, 
>> both 11.0
>>
>> I have used both QGis 1.5.0 and an old MapInfo Imutgui.exe to do this 
>> conversion, and I get the same results.
>>
>
> Zoltan,
>
> I can confirm that OGR is ignoring the precision of integer fields when
> translating and thus "integer 5" is just treated as "integer".  This in
> turn get translated to an 11 character wide field in the dbf file to
> hold the largest 32bit integer.  But when reading back such a wide field
> the shapefile driver treats it as "real" since the largest 11 character
> wide integer is larger than 32 bits.
>
> In GDAL/OGR trunk I've changed the shapefile driver a few weeks ago so 
> that
> unknown width fields are treated as 10 wide integer fields which are 
> still
> treated as integer when read back in an effort to partly avoid this 
> sort of
> problem.  I'm not sure if that change was backported.
>
> But I think there is also an issue with the mapinfo driver which seems to
> be ignoring the precision of integer fields.  I found it also ignores the
> precision of Decimal fields which are treated as real even if there are
> no decimal points.
>
> Could you file a ticket in the GDAL/OGR Trac on this?  I'll try to get it
> fixed up for GDAL/OGR 1.8.
>
> Best regards,
Hi Frank,
I've filed ticket #3853 - thanks.
I'm obviously available to help where possible.

Kind regards,
Zoltan




-- 

===========================================
Zoltan Szecsei PrGISc [PGP0031]
Geograph (Pty) Ltd.
P.O. Box 7, Muizenberg 7950, South Africa.

65 Main Road, Muizenberg 7945
Western Cape, South Africa.

34° 6'16.35"S 18°28'5.62"E

Tel: +27-21-7884897  Mobile: +27-83-6004028
Fax: +27-86-6115323     www.geograph.co.za
===========================================



-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1170 / Virus Database: 426/3275 - Release Date: 11/23/10



More information about the gdal-dev mailing list