-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fromWKT should fail if neither EMPTY or coordinates are supplied #28574
Comments
Author Name: Jürgen Fischer (@jef-n)
http://www.opengeospatial.org/standards/sfa defines for example for a POINT: ::= EMPTY ::= | So "Point" would not be ok. QGIS however, does allow and produce weird stuff...
LINESTRING GEOMETRYCOLLECTION Also see https://issues.qgis.org/issues/14640 to 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: ::= EMPTY ::= | So "Point" would not be ok. QGIS however, does allow and produce weird stuff... >>> for type in "POINT", "LINESTRING", "POLYGON", "GEOMETRYCOLLECTION", "MULTIPOINT": >>> g = QgsGeometry.fromWkt(type) >>> print(type) >>> print(g) >>> print(g.asWkt()) POINT LINESTRING LineString () POLYGON GEOMETRYCOLLECTION GeometryCollection () MULTIPOINT MultiPoint () Related #22604 |
Author Name: Nyall Dawson (@nyalldawson) I don't think there's an issue here. By design, QGIS' WKT parser is very forgiving and is designed to accept many types of invalid WKT strings, converting them wherever possible to actual geometries.
<QgsGeometry: > is a null geometry, so that's correct -- we can't convert the string "point" to a meaningful geometry.
This looks correct - we've been forgiving and interpreted the string as an empty linestring (ignoring the issue that .asWkt() should return "LineString EMPTY" here -- that's a different issue).
In this case we haven't been able to parse the invalid WKT -- without even an exterior ring there's nothing here, so the returned geometry is null.
Again, looks correct to me -- we've been forgiving and interpreted this as an empty geometry collection.
Same again -- we've interpreted as an empty multipoint.
|
Author Name: Loïc BARTOLETTI (@lbartoletti) |
Author Name: Giovanni Manghi (@gioman) Nyall Dawson wrote:
Nyall should this be closed? |
Fixed in #9645 |
Author Name: Johannes Kroeger (Johannes Kroeger)
Original Redmine Issue: 20754
Affected QGIS version: 3.5(master)
Redmine category:geometry
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:
So "Point" would not be ok. QGIS however, does allow and produce weird stuff...
Related #22604
The text was updated successfully, but these errors were encountered: