Hi list
I'm trying to create a plugin that creates a new layer using the
memory provider. I'd like this new layer to have the same crs as
another layer ('linesLayer' in my code below). All is going well,
except that when I add the new layer to the mapLayerRegistry I always
get prompted for selecting the new layer's crs. So, how do I go about
defining it programatically? What I want is to not be bothered with
the dialog to select my layer's crs during the execution of the
plugin. Currently I am doing:
# python code
pointLayer = QgsVectorLayer("Point", "temporary_points", "memory")
pointLayer.setCrs(linesLayer.crs())
# rest of the code
self.layerRegistry.addMapLayer(pointLayer)
Thank you
p.s. - I have been following the examples at the pyqgis cookbook[1]
and I think it is a great learning tool!
[1] - http://mapserver.sk/~wonder/qgis/html/index.html
--
___________________________ ___ __
Ricardo Garcia Silva
_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer