Opened 16 years ago
Closed 14 years ago
#1040 closed patch (fixed)
[PATCH] qgis crashes when I try to add RPF A.TOC file (also: RasterLite support)
Reported by: | hamiltonsean69 | Owned by: | jef |
---|---|---|---|
Priority: | major: does not work as expected | Milestone: | Version 2.0.0 |
Component: | Rasters | Version: | Trunk |
Keywords: | RPF | Cc: | rouault |
Must Fix for Release: | Yes | Platform: | All |
Platform Version: | Awaiting user input: | no |
Description
When I try to add a raster layer and select RPF>A.TOC file the entire program closes out without any warning or anything. This occurs on both the windows version and Linux version that I am using. This map data is good. It was download striaght from NGA website on a secret network.
Attachments (2)
Change History (15)
comment:1 by , 16 years ago
Platform Version: | → Fedora Core 8 |
---|---|
Version: | HEAD → 0.9.1 |
comment:2 by , 16 years ago
comment:3 by , 16 years ago
Platform: | Fedora → All |
---|---|
Platform Version: | Fedora Core 8 |
Summary: | qgis crashes when I try to add RPF A.TOC file → [PATCH] qgis crashes when I try to add RPF A.TOC file |
by , 16 years ago
Attachment: | qgis_qgsrasterlayer_bug1040.patch added |
---|
comment:4 by , 16 years ago
Cc: | added |
---|
Frank,
I add you in CC as I don't know who to assign this. You might probably know better than me.
comment:5 by , 16 years ago
Cc: | added; removed |
---|---|
Owner: | changed from | to
I have incorporated a variation on this patch in trunk (r...) that also treats files without bands as invalid in the isValidRasterFileName().
Currently isValidRasterFileName() does not provide any mechanism to report an error to the user, so the user just sees "is not a supported dataset". I would also like to change this, but I will address this as a followup patch. Even is also quite right that some sort of subdataset selection dialog would be very desirable for datasets like this with subdatasets.
comment:7 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I have commited a change in trunk (r8694) that improves error propagation for raster layer open failures. In particular isValidRasterFileName() now returns an error message if the filename is a raster, but just not supported for some particular reason.
I'd still like to do something about subdataset support, but this seems more involved and I'm not sure what to do. So I'm closing this particular ticket. Feel free to open a new ticket specifically requesting subdataset support as an enhancement.
comment:8 by , 14 years ago
Milestone: | → Version 1.5.0 |
---|---|
Must Fix for Release: | No → Yes |
Priority: | critical: causes crash or data corruption → major: does not work as expected |
Resolution: | fixed |
Status: | closed → reopened |
Version: | 0.9.1 → HEAD |
The same problem makes it impossible to open a RasterLite db with more than one raster layer, see: https://trac.osgeo.org/gdal/ticket/3568
For instance, this: http://www.gaia-gis.it/planet_earth.sqlite fails: /home/paolo/Desktop/planet_earth.sqlite is not a supported raster data source This raster file has no bands and is invalid as a raster layer. Gdal can read it:
$ gdalinfo /media/disk/planet_earth.sqlite Driver: Rasterlite/Rasterlite Files: Size is 512, 512 Coordinate System is `' Subdatasets: SUBDATASET_1_NAME=RASTERLITE:/media/disk/planet_earth.sqlite,table=elevation SUBDATASET_1_DESC=RASTERLITE:/media/disk/planet_earth.sqlite,table=elevation SUBDATASET_2_NAME=RASTERLITE:/media/disk/planet_earth.sqlite,table=population SUBDATASET_2_DESC=RASTERLITE:/media/disk/planet_earth.sqlite,table=population SUBDATASET_3_NAME=RASTERLITE:/media/disk/planet_earth.sqlite,table=shaded_color SUBDATASET_3_DESC=RASTERLITE:/media/disk/planet_earth.sqlite,table=shaded_color SUBDATASET_4_NAME=RASTERLITE:/media/disk/planet_earth.sqlite,table=shaded_gray SUBDATASET_4_DESC=RASTERLITE:/media/disk/planet_earth.sqlite,table=shaded_gray Corner Coordinates: Upper Left ( 0.0, 0.0) Lower Left ( 0.0, 512.0) Upper Right ( 512.0, 0.0) Lower Right ( 512.0, 512.0) Center ( 256.0, 256.0) $ gdalinfo RASTERLITE:/media/disk/planet_earth.sqlite,table=elevation Driver: Rasterlite/Rasterlite Files: /media/disk/planet_earth.sqlite Size is 43200, 18000 Coordinate System is: GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0, AUTHORITY["EPSG","8901"]], UNIT["degree",0.01745329251994328, AUTHORITY["EPSG","9122"]], AUTHORITY["EPSG","4326"]] Origin = (-180.000000000000000,89.999999999999972) Pixel Size = (0.008333333333300,-0.008333333333300) Metadata: TILE_FORMAT=JPEG Image Structure Metadata: INTERLEAVE=PIXEL COMPRESSION=JPEG Corner Coordinates: Upper Left (-180.0000000, 90.0000000) (180d 0'0.00"W, 90d 0'0.00"N) Lower Left (-180.0000000, -60.0000000) (180d 0'0.00"W, 60d 0'0.00"S) Upper Right ( 180.0000000, 90.0000000) (180d 0'0.00"E, 90d 0'0.00"N) Lower Right ( 180.0000000, -60.0000000) (180d 0'0.00"E, 60d 0'0.00"S) Center ( -0.0000000, 15.0000000) ( 0d 0'0.00"W, 15d 0'0.00"N) Band 1 Block=400x500 Type=Byte, ColorInterp=Red Overviews: 21600x9000, 10800x4500, 5400x2250, 2700x1125, 1350x563, 675x281, 338x141 Band 2 Block=400x500 Type=Byte, ColorInterp=Green Overviews: 21600x9000, 10800x4500, 5400x2250, 2700x1125, 1350x563, 675x281, 338x141 Band 3 Block=400x500 Type=Byte, ColorInterp=Blue Overviews: 21600x9000, 10800x4500, 5400x2250, 2700x1125, 1350x563, 675x281, 338x141
So this is a QGIS limitation : it cannot handle images with subdatasets.
comment:9 by , 14 years ago
Milestone: | Version 1.5.0 → Version 2.0.0 |
---|---|
Summary: | [PATCH] qgis crashes when I try to add RPF A.TOC file → [PATCH] qgis crashes when I try to add RPF A.TOC file (also: RasterLite support) |
comment:10 by , 14 years ago
Type: | defect → bug |
---|
by , 14 years ago
patch to allow addition of raster from multilayer datasources like rasterlite
comment:11 by , 14 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
Type: | bug → patch |
comment:12 by , 14 years ago
Status: | new → assigned |
---|
This still exists with 0.10.0, and this is not specifically due to the RPF A.TOC format, but the crash can happy with any raster format that declare subdatasets (HDF4, HDF5, OGDI raster, netCDF, RS2 and ADRG drivers are also concerned by this). The main raster has no data itself, but declares a list of subdatasets that can be opened by GDALOpen.
Here's the stack trace of the crash
In fact, this is due to the following code snipet that makes the assumption that the return of GDALGetRasterBand(hDS, 1) will be non-NULL.
The quickest fix is to apply the attached patch. In a longer term, it may be good to support subdatasets, by displaying the list of subdatasets to the user, as OpenEV does.