3

I have some layers containing DAT,MAP and TAB files, when I loaded these layers into QGIS some layers have check boxes before layer name and some layers won't like showing in below image.

enter image description here

In the above image you can see that boundary layer have the check box and compare_layer shows a icon instead of check box.

Now the problem I am facing is I am not able to delete the features from the compare_layer table and also from the layers similar to this kind.

When am trying to delete a feature from the this layer table and trying to save the layer, it throws an error like Could not commit changes to layer and compare_layer: OGR error deleting feature 15:

How can I solve this issue?

3
  • compare_layer is just a table. It has no feature to be shown in the canvas, that is why there is no check box.
    – ahmadhanb
    Jan 23 '19 at 6:34
  • but why it is not allowing to delete features from the table. Do you have any idea ??
    – Virat ABD
    Jan 23 '19 at 6:38
  • Because it is not a feature it is a table. This table should be connected with a feature having the same name. In this case you need to load the feature not the table into the canvas. However, if this table has no feature associated with it, then you can open it in any text editor like Notepad++. Before editing the table make sure to have a backup of the table to avoid corrupting the file if you found that the table is associated with a feature later. I cannot answer for sure because there is detailed information in your question about this table.
    – ahmadhanb
    Jan 23 '19 at 6:44
1

This is currently (January 2019 - now being fixed for future releases) a bug in the GDAL/OGR tools which QGIS uses to open/save TAB files. It is possible to edit the data, but not to delete a line of data. This applies when editing a dataset, saved in the TAB format, where the dataset has no geometries (no map features).

Your compare_layer layer is like this - which is why it looks different in the list of layers in the layers panel. There's no check box beside it because you can't hide/show the layer, because there are no map features to hide/show. This 'layer' is data only.

.........

In addition, for clarity, you should also have understood the following (which aren't part of the problem, but which seem to have confused you):

The various separate files you can see in a file browser (DAT, TAB, MAP) aren't really 'separate' files at all as far as QGIS (or indeed any other GIS system) is concerned. They all belong together - and you should consider them really as one file (which happens to be broken up into separate bits). What you should see - if you look at these with a file browser - is a set of files all with the same name (but these different endings). To load this one file-in-several-bits file into QGIS you only need to open the .TAB file. The other bits (associated files) are dealt with automatically in doing this.

8
  • Thank you @Rostranimin for your suggestion, still facing the same error even i am loading only TAB file.
    – Virat ABD
    Jan 24 '19 at 14:00
  • So you already know/expect that the 'boundary' layer has geometry (features on the map) - and you already know that 'compare_layer' has no geometry (no features on the map)? Is that correct? Is this what you expect? And you know that in either case to make it possible to edit the data/features you need to click the 'toggle editing' button? And this works for the data in boundary.TAB but it doesn't work for the data in compare_layer.TAB ? Is that right? Have I understood? Jan 24 '19 at 15:15
  • Interesting/surprising - I just replicated your problem. I created myself a new TAB dataset - starting with a csv text file, then saving as a TAB file (actually makes 4 files test.tab, test.map, test.dat and test,id ). I also can't delete an item in this table and save. Deleting is fine initially, but attempting to save the change throws up an error (to say that QGIS can't commit the change). To my mind you've hit a limitation of the ability of QGIS (through the use of OGR) to save to the TAB format. It should be said that ADDING data to the table works fine - there's only issues deleting. Jan 24 '19 at 15:25
  • Workaround... use 'save as' after making the deletions, and save the tab file(s) with a new name. Better still, save to an alternate GIS format (not TAB) without this problem. Take note that QGIS (OGR) only gained the ability to edit TAB files relatively recently, and that TAB files are probably becoming much less common, so I'm guessing you may be the first to have encountered this issue... Jan 24 '19 at 15:39
  • Just to say - We/you may get better answers if we/you update the question/title to clarify these specifics. Jan 24 '19 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.