[Qgis-developer] QgsGeometry.fromWkt fails if WKT contains SRID

Matthias Kuhn matthias.kuhn at gmx.ch
Fri Dec 21 08:10:46 PST 2012


Hi,

I want to get a QgsGeometry from the following string, produced by PostGIS:

/SRID=21781;LINESTRING(749566.243 264032.415,749589.521 264042.261)//
/
/QgsGeometry.fromWkt/ returns NULL, because /GEOSWKTReader_read/ throws 
an exception
(ParseException: Unknown type: 'SRID=21781;POLYGON')

What is the proper way to handle this:
- Open an issue upstream to fix it at GEOS level?
- Strip the SRID part from the WKT before calling GEOSWKTReader_read?
- Anything else?

Regards,
Matthias


More information about the Qgis-developer mailing list