Opened 11 years ago
Closed 10 years ago
#5259 closed defect (worksforme)
vrt-ods/xls driver problem
Reported by: | lasseman | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | default | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: |
Description
With the ods-driver: If the cell at first row of the last column is empty it crashes QGIS
With the xls-driver: If you have a column at the end and just delete it with delete button (not command "delete column"), there seem to be something left that causes QGIS 2.0 to crash. If you "Delete column" it is working.
Attached are zipfile with example spreadsheet files
I run Ubuntu 12.04 QGIS 2.01 compiled against GDAL/OGR 1.10.0 LibreOffice Version 4.0.4.2
Attachments (1)
Change History (5)
by , 11 years ago
follow-up: 2 comment:1 by , 11 years ago
comment:2 by , 11 years ago
Replying to rouault:
I cannot reproduce with OGR itself. This might perhaps be a QGIS problem. I've tried to reproduce with a QGIS git version from a few weeks/months ago and didn't notice issues. One odd thing in your description is that you mention you tried to delete a column in a .xls file, but the OGR XLS driver is read-only, and QGIS doesn't allow (logically) to toggle edition...
What could perhaps help diagnose what happens is that you launch qgis under gdb ("gdb qgis" and then type "run") and display a backtrace when it crashes (" bt " )
I tried with ogrinfo and I got same error. (also. I didn't mean deleting columns when open in qgis, but when qgis is closed.)
With ogrinfo I get the following error when opening the demo vrt-file "ogrinfo -ro -al demoError.vrt"
gives following output:
INFO: Open of `demoError.vrt'
using driver `VRT' successful.
ERROR 1: Unable to identify source X or Y field for PointFromColumns encoding.
Layer name: Sheet1 Geometry: Point Feature Count: 3 ERROR 1: Invalid index : -1 ERROR 1: Invalid index : -1 ERROR 1: Invalid index : -1 ERROR 1: Invalid index : -1 ERROR 1: Invalid index : -1 ERROR 1: Invalid index : -1 Extent: (0.000000, 0.000000) - (0.000000, 0.000000) Layer SRS WKT: GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
TOWGS84[0,0,0,0,0,0,0], AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9108"]],
AUTHORITY["EPSG","4326"]]
ERROR 1: Invalid index : -1 ERROR 1: Invalid index : -1 OGRFeature(Sheet1):1
POINT (0 0)
ERROR 1: Invalid index : -1 ERROR 1: Invalid index : -1 OGRFeature(Sheet1):2
POINT (0 0)
ERROR 1: Invalid index : -1 ERROR 1: Invalid index : -1 OGRFeature(Sheet1):3
POINT (0 0)
anders@hemsnabeldatorn:
And if I do on the working file: ogrinfo -ro -al demoWorking.vrt
following output:
INFO: Open of `demoWorking.vrt'
using driver `VRT' successful.
Layer name: Sheet1 Geometry: Point Feature Count: 2 Extent: (0.000000, 0.000000) - (20.017370, 60.238190) Layer SRS WKT: GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
TOWGS84[0,0,0,0,0,0,0], AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9108"]],
AUTHORITY["EPSG","4326"]]
Coll_ID: String (0.0) ID: Integer (0.0) Registrerad: String (0.0) Artgrupp: String (0.0) Species: String (0.0) Author: String (0.0) Species_label: String (0.0) Bestämmare: String (0.0) Det_YEAR: Integer (0.0) Det_comment: String (0.0) Fertilitet: String (0.0) Coll_date: Date (0.0) Habitat: String (0.0) Habitat_eng: String (0.0) Följearter: String (0.0) Värdsdel: String (0.0) Nation: String (0.0) Län: String (0.0) Kommun: String (0.0) Landskap: String (0.0) Socken: String (0.0) Lokal: String (0.0) Lokal_eng: String (0.0) Comment: String (0.0) Comment_eng: String (0.0) Hidden_comment: String (0.0) Popsample: String (0.0) Waypoint: String (0.0) Lat: Real (0.0) Lon: Real (0.0) Alt: String (0.0) Coord_precision(meter): String (0.0) Coordsystem: String (0.0) Karta: String (0.0) Silica: String (0.0) Insamlare: String (0.0) Additional_collector: String (0.0) Antal_dubletter: Integer (0.0) Dubletter: String (0.0) OGRFeature(Sheet1):2
Coll_ID (String) = AL612 (702) ID (Integer) = 612 Registrerad (String) = (null) Artgrupp (String) = V- Species (String) = Asplenium septentrionale Author (String) = (null) Species_label (String) = Asplenium septentrionale Bestämmare (String) = Anders Larsson Det_YEAR (Integer) = 2012 Det_comment (String) = (null) Fertilitet (String) = (null) Coll_date (Date) = 2012/08/06 Habitat (String) = Sydvästvänd kustberg Habitat_eng (String) = (null) Följearter (String) = Asplenium trichomanes, Veronica spicata, Polypodium vulgare, Woodsia ilvensis Värdsdel (String) = Europe Nation (String) = Åland Län (String) = (null) Kommun (String) = Finström Landskap (String) = (null) Socken (String) = (null) Lokal (String) = Vid bron på åland Lokal_eng (String) = (null) Comment (String) = (null) Comment_eng (String) = (null) Hidden_comment (String) = (null) Popsample (String) = (null) Waypoint (String) = (null) Lat (Real) = 60.23819 Lon (Real) = 20.01737 Alt (String) = (null) Coord_precision(meter) (String) = (null) Coordsystem (String) = (null) Karta (String) = (null) Silica (String) = (null) Insamlare (String) = Anders Larsson Additional_collector (String) = (null) Antal_dubletter (Integer) = 2 Dubletter (String) = (null) POINT (20.01737 60.23819)
OGRFeature(Sheet1):3
Coll_ID (String) = (null) ID (Integer) = (null) Registrerad (String) = (null) Artgrupp (String) = (null) Species (String) = (null) Author (String) = (null) Species_label (String) = (null) Bestämmare (String) = (null) Det_YEAR (Integer) = (null) Det_comment (String) = (null) Fertilitet (String) = (null) Coll_date (Date) = (null) Habitat (String) = (null) Habitat_eng (String) = (null) Följearter (String) = (null) Värdsdel (String) = (null) Nation (String) = (null) Län (String) = (null) Kommun (String) = (null) Landskap (String) = (null) Socken (String) = (null) Lokal (String) = (null) Lokal_eng (String) = (null) Comment (String) = (null) Comment_eng (String) = (null) Hidden_comment (String) = (null) Popsample (String) = (null) Waypoint (String) = (null) Lat (Real) = (null) Lon (Real) = (null) Alt (String) = (null) Coord_precision(meter) (String) = (null) Coordsystem (String) = (null) Karta (String) = (null) Silica (String) = (null) Insamlare (String) = (null) Additional_collector (String) = (null) Antal_dubletter (Integer) = (null) Dubletter (String) = (null) POINT (0 0)
comment:3 by , 11 years ago
The issue is that the driver doesn't manage to auto-detect that the first line in your error sheets is a header line. Probably because of null columns at the right. You have to force it by setting the OGR_ODS_HEADERS=FORCE and OGR_XLS_HEADERS=FORCE environmenet variables. But that doesn't explain why you would see crashes
comment:4 by , 10 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Cannot reproduce the reported crashes. Please reopen if you can provide more elements on the crash
I cannot reproduce with OGR itself. This might perhaps be a QGIS problem. I've tried to reproduce with a QGIS git version from a few weeks/months ago and didn't notice issues. One odd thing in your description is that you mention you tried to delete a column in a .xls file, but the OGR XLS driver is read-only, and QGIS doesn't allow (logically) to toggle edition...
What could perhaps help diagnose what happens is that you launch qgis under gdb ("gdb qgis" and then type "run") and display a backtrace when it crashes (" bt " )