Re: [Qgis-user] Writing plugins::"export selected object to OGR"

2007-02-10 Thread Marco Hugentobler
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


Re: [Qgis-user] Writing plugins::"export selected object to OGR"

2007-02-08 Thread 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


Re: [Qgis-user] Writing plugins::"export selected object to OGR"

2007-02-07 Thread Wolfgang Qual

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


Re: [Qgis-user] Writing plugins::"export selected object to OGR"

2007-02-07 Thread Martin Dobias

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


Re: [Qgis-user] Writing plugins::"export selected object to OGR"

2007-02-06 Thread Oleg Gusev
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";
...

 Oleg.
___
Qgis-user mailing list
Qgis-user@lists.qgis.org
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user


Re: [Qgis-user] Writing plugins::"export selected object to OGR"

2007-02-06 Thread Wolfgang Qual

Hello Oleg,
sorry, but I did not find the "export to shapefile" function in qgis. 
Could you give me a hint?
I also use the oracle-plugin of Stephan Holl - therefore, it would be 
nice for me to export such features to another format (shapefile, maybe 
postgis).


Greetings,
Wolfgang



Oleg Gusev schrieb:

Am Dienstag, 6. Februar 2007 12:33 schrieb Wolfgang Qual:
  
Ogr2ogr should be used for this purpose (using the sql-option). 



Hi Wolfgang,

 qgis already has an export to shapefile implementation, so
 export to OGR will need a replacement of the
 "esri shapefile" string to the appropriate format name.

 Oleg.
___
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


Re: [Qgis-user] Writing plugins::"export selected object to OGR"

2007-02-06 Thread Oleg Gusev
Am Dienstag, 6. Februar 2007 12:33 schrieb Wolfgang Qual:
>
> Ogr2ogr should be used for this purpose (using the sql-option). 
>
Hi Wolfgang,

 qgis already has an export to shapefile implementation, so
 export to OGR will need a replacement of the
 "esri shapefile" string to the appropriate format name.

 Oleg.
___
Qgis-user mailing list
Qgis-user@lists.qgis.org
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user


Re: [Qgis-user] Writing plugins::"export selected object to OGR"

2007-02-06 Thread Wolfgang Qual

Hi Paolo,
ok. I am using qgis-0.8 (5975M -?) - so it would be already possible to 
write a plugin in python?

Wolfgang

Paolo Cavallini schrieb:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I believe the new python bindings will make this far easier.
pc

Wolfgang Qual ha scritto:
  

Hi list,
I do not have any experience in writing plugins for QGIS, but I am just
curious: would it be hard to write a plugin for QGIS, which would allow
the user to
export a selection of a layer (or the whole layer) into choosable
ogr-format?
Ogr2ogr should be used for this purpose (using the sql-option). I think,
having such a plugin would be great, as QGIS offers the possibility to
perform a)queries on attribute table and b) a seletion by simply
click&drag with the mouse. At the moment, it is only possible to extract
selected features with GRASS-data. Therefore, I first have to import the
whole dataset into GRASS and do the select afterwards.

What do you think?
Wolfgang



- --
Paolo Cavallini
email+jabber: [EMAIL PROTECTED]
www.faunalia.it
Piazza Garibaldi 5 - 56025 Pontedera (PI), Italy   Tel: (+39)348-3801953
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFyGhB/NedwLUzIr4RAqEGAJ4oiY5OqWJ2Qh3UQ/YRfzKSL3S38wCfcj6p
Laz1Uf+beDAJ53QQUweAizg=
=GzbM
-END PGP SIGNATURE-

  


--

*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


Re: [Qgis-user] Writing plugins::"export selected object to OGR"

2007-02-06 Thread Paolo Cavallini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I believe the new python bindings will make this far easier.
pc

Wolfgang Qual ha scritto:
> Hi list,
> I do not have any experience in writing plugins for QGIS, but I am just
> curious: would it be hard to write a plugin for QGIS, which would allow
> the user to
> export a selection of a layer (or the whole layer) into choosable
> ogr-format?
> Ogr2ogr should be used for this purpose (using the sql-option). I think,
> having such a plugin would be great, as QGIS offers the possibility to
> perform a)queries on attribute table and b) a seletion by simply
> click&drag with the mouse. At the moment, it is only possible to extract
> selected features with GRASS-data. Therefore, I first have to import the
> whole dataset into GRASS and do the select afterwards.
> 
> What do you think?
> Wolfgang

- --
Paolo Cavallini
email+jabber: [EMAIL PROTECTED]
www.faunalia.it
Piazza Garibaldi 5 - 56025 Pontedera (PI), Italy   Tel: (+39)348-3801953
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFyGhB/NedwLUzIr4RAqEGAJ4oiY5OqWJ2Qh3UQ/YRfzKSL3S38wCfcj6p
Laz1Uf+beDAJ53QQUweAizg=
=GzbM
-END PGP SIGNATURE-
___
Qgis-user mailing list
Qgis-user@lists.qgis.org
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-user


[Qgis-user] Writing plugins::"export selected object to OGR"

2007-02-06 Thread Wolfgang Qual

Hi list,
I do not have any experience in writing plugins for QGIS, but I am just 
curious: would it be hard to write a plugin for QGIS, which would allow 
the user to
export a selection of a layer (or the whole layer) into choosable 
ogr-format?
Ogr2ogr should be used for this purpose (using the sql-option). I think, 
having such a plugin would be great, as QGIS offers the possibility to 
perform a)queries on attribute table and b) a seletion by simply 
click&drag with the mouse. At the moment, it is only possible to extract 
selected features with GRASS-data. Therefore, I first have to import the 
whole dataset into GRASS and do the select afterwards.


What do you think?
Wolfgang
--

*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