Bug report #20996

QGIS Master does not export from Multilinestring Geometry type and does not recognize Geometry Type Linestring saved by QGIS 2

Added by Antonio Viscomi almost 2 years ago. Updated almost 2 years ago.

Status:Rejected
Priority:High
Assignee:-
Category:Geometry
Affected QGIS version:3.5(master) Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:wontfix
Crashes QGIS or corrupts data:No Copied to github as #:28815

Description

Hi all,
I need a Linestring type shapefile then:
- I tried to convert my data to Linestring using QGIS Master https://github.com/qgis/QGIS/commit/aafd84812e;
- the conversion come out with a correct "converted" memory file (Screenshot 1);
- I tried to save "converted" file to a permanent file (selecting Linestring Type from export dialog);
well,
- the new file Is a Linestring type while It is a memory (Screenshot 1) whereas if I load It from "Open Layer" as a new layer,
It change type in Multilinestring instead of a Linestring (Screenshot 2).

Moreover,

If I try to open a QGIS 2 (screenshot 3) converted Linestring in QGIS Master, the opened file It is yet Multilinestring (Screenshot 4)

I attach here the some screenshots and data (original data and Linestring data converted by Master and by QGIS 2)

Regards

Geometry_type.7z (364 KB) Antonio Viscomi, 2019-01-14 04:37 PM

gpkg_properties.tif (2.49 MB) Antonio Viscomi, 2019-01-15 09:44 AM

exported.gpkg (1.11 MB) Antonio Viscomi, 2019-01-15 09:45 AM

History

#1 Updated by Nyall Dawson almost 2 years ago

  • Resolution set to wontfix
  • Status changed from Open to Rejected

This is by design. In qgis 3 line/polygon shapefiles are always treated as multipart. This is because the shapefile format does not differentiate between the two, and in qgis it is necessary to know in advance if ANY feature in the layer will be multipart. Use geopackage if you need strict single/multi typing.

#2 Updated by Antonio Viscomi almost 2 years ago

Hi Nyall,
Thanks for suggestion but...
Why allow to export shapefiles as Linestring?
Cheers

#3 Updated by Nyall Dawson almost 2 years ago

That list isn't filtered by export format -- I guess we should consider that!

#4 Updated by Antonio Viscomi almost 2 years ago

Nyall Dawson wrote:

This is by design. In qgis 3 line/polygon shapefiles are always treated as multipart. This is because the shapefile format does not differentiate between the two, and in qgis it is necessary to know in advance if ANY feature in the layer will be multipart. Use geopackage if you need strict single/multi typing.

Nyall,
I just tried to export my multilinestring in Linestring in a gpkg as you suggested,
well the result is yet a multilinestring... Is there anything that is not clear to me?

I attach gpkg and screenshot here

Cheers

Also available in: Atom PDF