Bug report #16217
fromWkt should accept any whitespace
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Unknown | ||
Affected QGIS version: | 2.18.3 | Regression?: | No |
Operating System: | Windows | Easy fix?: | No |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 24127 |
Description
This bug was discovered with the QuickWKT plug-in with copy/paste from Excel, which uses tabs delimiters when pasting into a text window. For example, "POINT (180398 5459331)", where the whitespace in between the two values is a tab character, is considered by the QGIS WKT parser as invalid (it is not).
From a QGIS Python console:
# With space, there are no problems geom = QgsGeometry.fromWkt("POINT (180398 5459331)") print(geom is not None) # True # With tab, it does not read the WKT geom = QgsGeometry.fromWkt("POINT (180398\\t5459331)") print(geom is not None) # False
Most other WKT parsers (PostGIS, GEOS, etc.) are more relaxed, and handle any whitespace without issue
(E.g. "SELECT ST_AsEWKT(E'SRID = 123;\
\
POINT\
(1\\t\
3)'::geometry);" works)
History
#1 Updated by Nyall Dawson almost 8 years ago
- Status changed from Open to Closed
Fixed in changeset 5bbdb1f1c3d07391040b11e7be3b08fe8def0d4c.
#2 Updated by Jürgen Fischer about 7 years ago
- Category set to Unknown