Bug report #20754

Updated by Jürgen Fischer almost 2 years ago

QGIS allows geometries to be created using a string like "GeometryType" without either specifying the coordinates or EMPTY.

http://www.opengeospatial.org/standards/sfa defines for example for a POINT:

<pre>
<empty set> ::= EMPTY

<point text> ::= <empty set> | <left paren> <point> <right
paren>
</pre>

So "Point" would not be ok. QGIS however, does allow and produce weird stuff...

<pre>
>>> for type in "POINT", "LINESTRING", "POLYGON", "GEOMETRYCOLLECTION", "MULTIPOINT":
>>> g = QgsGeometry.fromWkt(type)
>>> print(type)
>>> print(g)
>>> print(g.asWkt())
POINT
<QgsGeometry: >

LINESTRING
<QgsGeometry: LineString ()>
LineString ()
POLYGON
<QgsGeometry: >

GEOMETRYCOLLECTION
<QgsGeometry: GeometryCollection ()>
GeometryCollection ()
MULTIPOINT
<QgsGeometry: MultiPoint ()>
MultiPoint ()
</pre>

Related #14640


Also see https://issues.qgis.org/issues/14640

Back