Hi,

I have plugin which creates memory based layer and loads data into
this layer using its own reader.

"""
class MyLayer(QgsVectorLayer):
    def __init__(self, name):
        super(MyLayer, self).__init__('Point?crs=epsg:4326',
                                            name,
                                            'memory')

    def load(self, reader):
        for f in reader:
            self._process_row(f) # add features to the map layer
"""

The problem occures when user stores such layer in the project. Then
the project file contains only:

"""
     
<datasource>memory?geometry=Point&amp;crs=EPSG:4326&amp;field=ader_microSvh:(0,0)...</datasource>
"""

So after loading the project, empty layer appears (with defined
attributes), but with no points loaded. Is there any way how to define
for such layer python code which would perform loading points using
plugin reader when opening a project?

Of course plugin could store (export) loaded data eg. into SQLite DB,
but this is not the way I would like to go.

Thanks in advance for any pointers, Martin

-- 
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to