Opened 13 years ago

Last modified 10 years ago

#3853 closed defect

Data types change converting from MID/MIF to SHP — at Version 1

Reported by: zoltan Owned by: chaitanya
Priority: normal Milestone: 1.11.1
Component: OGR_SF Version: unspecified
Severity: normal Keywords: MITAB
Cc: warmerdam, Daniel Morissette, aboudreault, lpercich

Description (last modified by warmerdam)

When converting a SHP to a MID-MIF format, the data precision is lost. EG: Integer (10) becomes Integer [not Integer (10) to show longint] in the MIF file. On return from MID-MIF to Shape, I force the MIF file to contain Integer (10) in the schema, and it arrives in SHP as a Real value. Note that it is a technical requirement from our client that the Integer Length is reflected as 10 (and not zero), if it is "10" in the MIF file.

This is holding up a delivery dataset to a client, but I do understand if this cannot be solved soon.

3 Attachments (viewed via qgis 1.5.0)

original_SHP_schema.jpg is original client data.

After exporting from QGIS as midmif, the resulting MIF file contains:

Columns 25
  FEAT_TYPE_ Integer
  OPERATIONA Integer
  .
  .
  GID Integer

etc....[note no "5" or "10" after the "Integer"]

re_read_midmif.jpg Is as the midmif files are opened by QGIS 1.5.0

shp_from_midmif.jpg After saving above midmif as SHP, exiting, then re-opening QGIS to read the resulting SHP file. Note that they are all "Integer 10" instead of some being "Integer 5", as our client is insisting.

Thanks & regards, Zoltan

Change History (4)

by zoltan, 13 years ago

Attachment: shp_from_midmif.jpg added

by zoltan, 13 years ago

Attachment: re_read_midmif.jpg added

by zoltan, 13 years ago

Attachment: original_SHP_schema.jpg added

comment:1 by warmerdam, 13 years ago

Cc: warmerdam Daniel Morissette aboudreault added
Description: modified (diff)
Keywords: MITAB added
Milestone: 1.8.0
Owner: changed from warmerdam to chaitanya
Severity: blockernormal

Chaitanya,

Please work on this promptly. Disregard the shapefile aspects - I believe they are already adequately addressed. The key is to ensure that OGR recognises the field width for integer fields, and treats Decimal(n,0) as integer, not real.

I think the provided dataset demonstrates Integer(n) fields. I will email you with a dataset containing Decimal(n,0) fields for you to test with.

I imagine changes will need to go upstream to MITAB though I presume the issue is primarily with the OGRLayer wrapper for MITAB. Work with Alan and/or Daniel on mitab updates.

Please manufacture a small test for the test suite to verify corrections one you have them.

Note: See TracTickets for help on using tickets.