GetNextFeature error handling

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GetNextFeature error handling

Tim Sutton
Hi

Im trying to file away an outstanding bug in QGIS:

http://sourceforge.net/tracker/index.php?func=detail&aid=1211058&group_id=55820&atid=478378

If you look at the stack trace that the original poster kindly provided, you
will notice that the problem occurs in OGRShapeLayer::GetNextFeature (). Of
course the real cause of the problem is that the user has an invalid
shapefile (there is inconsistency with the number of points compared to the
number of dbf recs).

My question is, is there any way to gracefully trap this error?

I tested on gdal 1.2.6 btw

Many thanks

Tim Sutton

--
"The mind once expanded to the dimensions of larger ideas never returns to its
original dimensions."

_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GetNextFeature error handling

Frank Warmerdam
On 9/18/05, Tim Sutton <[hidden email]> wrote:

> Hi
>
> Im trying to file away an outstanding bug in QGIS:
>
> http://sourceforge.net/tracker/index.php?func=detail&aid=1211058&group_id=55820&atid=478378
>
> If you look at the stack trace that the original poster kindly provided, you
> will notice that the problem occurs in OGRShapeLayer::GetNextFeature (). Of
> course the real cause of the problem is that the user has an invalid
> shapefile (there is inconsistency with the number of points compared to the
> number of dbf recs).
>
> My question is, is there any way to gracefully trap this error?
>
> I tested on gdal 1.2.6 btw

Tim,

I tried the bad shapefile from the bug report with the current ogrinfo and
it just emits an error message but doesn't crash.  I did apply a patch to
OGR when this problem was discussed a week or two ago (on IRC?), so
that may be why I don't get a crash.

By the way, it looks like the dbf has no fields.

Best regards,

--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
Gdal-dev mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/gdal-dev