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

Matthias Kuhn matthias.kuhn at gmx.ch
Fri Dec 21 08:12:27 PST 2012


On 12/21/2012 05:10 PM, Matthias Kuhn wrote:
> 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')
I mixed up the geometry and error message (Polygon and LineString). It 
failed with both.
>
> 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
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer



More information about the Qgis-developer mailing list