0

We are trying to move from Mapinfo to QGIS. We have some tables with .TAB format. What we normally do is copy feature from one layer into another layer (to the same layer). But it does not work in QGIS. Geometry type of feature are Line (WKB type: "LineString"). Properties for both layers are identical.

This is the link for two tables we want to copy https://drive.google.com/drive/u/0/folders/1dDgYWhYe9KcTeaElJnKn43O9wlYD5SLI

Can someone tell me how to do this? I want to copy all the feature from cable to cable2 table.

  • 1
    Are you pasting into another TAB file? Are the features all the same geometry type (e.g. point, line, polygon, or text)? Are your source tables packed? If you're pasting into another format, it's possible that it doesn't support multiple geometry types like TAB files do. Further, your link triggered a warning with my antivirus software. So, I've removed it. – Fezter Jul 23 '18 at 2:22
  • I cant even past into the same table. it only past 1 out of 7. I dont know how to pack the table in QGIS. but I assume the source table is not packed. Can you tell me how can I upload a file here? – Ehsan Aliverdi Jul 23 '18 at 4:07
  • 2
    Please edit your post to address the questions I asked in the above comment. You're trying to paste from a TAB into the same TAB? What is the geometry type that you're trying to copy? You may have corrupt features. – Fezter Jul 23 '18 at 4:09
2

I've downloaded your datasets and discovered that your cable.TAB file contains multipart features. This alone should not prevent the copying and pasting of features into another dataset. However, trying to paste the features caused QGIS to not respond. I suspected there was something about the geometry that wasn't valid.

In fact, when I looked more closely at the direction of the lines, the segments of one of the multipart lines were going in opposite directions. This may have been the reason you can't paste them. enter image description here

I was able to explode the features into single part features using the following method in QGIS 3.0.3:

  1. Select all the features in cable.TAB
  2. In the Vector Menu, Geometry Tools, Multipart to singleparts
  3. Copy all single part lines
  4. Ensure cable2.TAB is editable and selected
  5. Paste all features into cable2.TAB

You could also inspect the lines individually, explode them, reverse the ones going in the wrong order, and connect them back up again.

Generally, for things like this, I think unless you have a very good reason to have multipart lines, I suggest you convert to single parts. You'll run into less problems like that.

  • Thanks alot, the method you mentioned will work. we are not allowed to change multi part to single part (it should stay as is as this is the way customer wants it) I was wondering if , is there a way to copy multi part line without changing it to single part) – Ehsan Aliverdi Jul 24 '18 at 1:52
  • I suspect the issue is the line with multiple segments pointing the wrong direction. You should be able to copy/paste the other ones without any trouble. You'll need to fix up the offending geometry. You can split them, then join them back after orienting them correctly. Orientation is usually pretty important with linear features such as cables. If this answer helped you please accept it. – Fezter Jul 24 '18 at 2:01

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.