Hi all,

Afaik QgsVectorFileWriter is pure lecagy code. At the beginning, it was used 
to create new (empty) vectorlayers. But now, the 
method 'createEmptyDataSource' of the ogr provider does it.

If there is a class in qgis core for creation of new datasets, then in my 
opinion it should be for all vector data providers, not only for ogr. This 
would require that vector data providers have a method to create empty 
datasets (like ogr provider has it now). There could be a new provider 
capability so that the qgis core knows which providers support it. Like this, 
it will be straightforward to implement 'save As' in a generic way, just 
create empty dataset and use methods addFeatures and addAttributes of 
QgsVectorLayer (like Martin described it).

cheers,
Marco 



Am Donnerstag, 8. Februar 2007 09:06 schrieb Martin Dobias:
> I think I could do only typical estimation when people work on it in
> spare time - once someone will volunteer to do it, we will have it.
> Whether for 0.9 or any other version - I don't know.
>
> Thinking about your idea to create a plugin, in fact only thing you
> need to do is to create a new (empty) shapefile (or other file type)
> with appropriate fields for attributes. Then you can open that new
> layer in QGIS and add all features from your data source to the new
> layer using QGIS vector provider.
>
> Martin
>
> On 2/8/07, Wolfgang Qual <[EMAIL PROTECTED]> wrote:
> > Hello Martin,
> > I agree that it would be better to have this "OGR-export"-functionality
> > inside the vector file writer class, but can you estimate when this will
> > be part of QGIS? 0.9/1.0...? Maybe it would be handsome to have a plugin
> > for the time in-between...
> >
> > Regards,
> > Wolfgang
> >
> > Martin Dobias schrieb:
> > > On 2/6/07, Oleg Gusev <[EMAIL PROTECTED]> wrote:
> > >> Am Dienstag, 6. Februar 2007 13:27 schrieben Sie:
> > >> > sorry, but I did not find the "export to shapefile" function in
> > >> > qgis. Could you give me a hint?
> > >>
> > >> In ./src/core/qgsvectorfilewriter.cpp
> > >>
> > >> QgsVectorFileWriter::QgsVectorFileWriter
> > >> ...
> > >>   mOutputFormat = "ESRI Shapefile"; //hard coded for now!
> > >> ...
> > >> QString driverName = "ESRI Shapefile";
> > >> ...
> > >
> > > The mentioned class in fact is not finished and I'm not sure it works
> > > at all. So far QGIS lacks the functionality of a generic OGR (or
> > > shapefile) output, so it might be better not to create a plugin for
> > > this - improving vector file writer class to be usable would be
> > > better.
> > >
> > > Martin
> > > _______________________________________________
> > > Qgis-user mailing list
> > > Qgis-user@lists.qgis.org
> > > http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user
> >
> > --
> >
> >         *Wolfgang Qual
> >
> > * *Referat für Gesundheit und Umwelt*
> > Umweltschutz
> > Umweltvorsorge
> > RGU-UW 11
> >
> > Bayerstraße 28a
> > 80335 München
> >
> > Telefon +49 - 89 - 233 - 4 77 17
> > Telefax +49 - 89 - 233 - 4 77 05
> >
> > http://www.muenchen.de/umweltatlas
> > [EMAIL PROTECTED]
> > Bitte beachten Sie die Hinweise zur elektronischen
> > Kommunikation mit der Landeshauptstadt München:
> > http://www.muenchen.de/ekomm
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user@lists.qgis.org
> http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.qgis.org
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user

Reply via email to