#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 , 17 years ago
comment:2 by , 17 years ago
Cc: | added |
---|---|
Component: | default → OGR_SF |
Keywords: | mitab added |
Owner: | changed from | to
comment:3 by , 17 years ago
Status: | new → assigned |
---|
I have contacted Stephen to get a copy of the file.
comment:4 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | assigned → closed |
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 , 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.
Unable to attach offending file. Please contact me for the data.