[Qgis-developer] Different behavior getting crs from SL and PG provider

Giuseppe Sucameli brush.tyler at gmail.com
Tue Aug 23 10:16:51 EDT 2011


Hi devs,
working on the import layer feature I noticed that there's a difference
when getting the layer CRS using the PG and SL provider's crs() method.

While the PG crs() calls the QgsCoordinateReferenceSystem::createFromSrid,
the SL crs method instead uses the
QgsCoordinateReferenceSystem::createFromPrj4.

This is an inconsistent behavior.

When I load a table with geometry and srid 3003,
if the source is a PG database I get a layer with the QGis 3003 definition
that contains towgs84 params, otherwise from SL I get a layer with a
custom CRS, similar to the QGis one but without the towgs84 params.

This creates some problems trying to import the SL layer into a PG database
because QGis is unable to get the postgisSrid from the SL layer with the
custom CRS, even if it should be 3003.

I think both should work in the same manner, but I don't know if it's more
correct to get crs from srid (in this case both the layers will use the QGis

crs definition) or from the proj4string.

Any idea?

-- 
Giuseppe Sucameli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20110823/e92e6ecd/attachment.html


More information about the Qgis-developer mailing list