Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#1658 closed defect (invalid)

OGR Problem with specific mapinfo file

Reported by: plasmab Owned by: Daniel Morissette
Priority: low Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords: mitab
Cc: warmerdam

Description

The attached mapinfo file (in zipped form) does not open using the following mechanism in current or older (1.2 through to trunk) versions of ogr. The code example is python but the same error is reported when using c# bindings.

This may be a broken file but it does load fine in MapInfo itself. Any help is appreciated.

Stephen Leary

Python 2.3.5 (#2, Aug 13 2005, 20:34:00) [GCC 4.0.2 20050806 (prerelease) (Debian 4.0.1-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import ogr ogr.OpenShared("PROMAP_SCO.TAB")

<ogr.DataSource instance at 0x402085ac>

ds = ogr.OpenShared("PROMAP_SCO.TAB") ds

<ogr.DataSource instance at 0x4020850c>

layer = ds.GetLayer() layer.GetFeatureCount()

40910

feat = layer.GetNextFeature()

ERROR 3: InitBlockFromData(): Invalid Block Type: got 3 expected 2 ERROR 5: GetNextFeatureId() failed: unable to set read pointer to feature id 1

Change History (5)

comment:1 by plasmab, 17 years ago

Unable to attach offending file. Please contact me for the data.

comment:2 by warmerdam, 17 years ago

Cc: warmerdam added
Component: defaultOGR_SF
Keywords: mitab added
Owner: changed from warmerdam to Daniel Morissette

comment:3 by Daniel Morissette, 17 years ago

Status: newassigned

I have contacted Stephen to get a copy of the file.

comment:4 by Daniel Morissette, 17 years ago

Resolution: invalid
Status: assignedclosed

I got a copy of the PROMAP_SCO.TAB dataset and was able to reproduce the error above using tab2tab from MITAB.

It seems that this is a corrupt dataset. The .ID file points to an invalid location in the .MAP file for record 1 (and possibly others), so it may be out of sync.

I loaded the file in MapInfo 8.5, it does display some data, this is most likely because MapInfo uses the spatial index embedded in the .map file to display the map view (instead of using the the record index in the .ID file). However, if you attempt to export the table to MIF in MapInfo, then you get a .MIF file with all NONE geometries, this confirms the theory that the .ID file is out of sync or corrupt since MapInfo needs to use the .ID file to scan objects by index and produce a .MIF file.

There is nothing we ca do about a corrupt dataset. Closing ticket as invalid.

comment:5 by plasmab, 17 years ago

Thankyou,

Sorry for wasting your time on this. If i had known it was invalid i would not have pushed it to you.

Note: See TracTickets for help on using tickets.