Re: [Qgis-developer] plugin dev - save to ogr vector file
Il 03/07/2012 20:17, Rob Nickerson ha scritto: I am brand new to QGIS (having got here from my work with OpenStreetMap) so apologies if I am posting this in the wrong place. What I am trying to do is adapt the fTools plugin so that it can save to any ogr verctor file format. The reason behind this is that I found the ESRI shapefile format to be restrictive (e.g. attribute values are limited to 254 chars - 80 in QGIS??). that would be a very welcome addition, thanks. please note that fTools are now incorporated also in Sextante plugin. The plugin also saves by default in shp, but users can select other formats as well. could this solve your problem? all the best. -- Paolo Cavallini - Faunalia www.faunalia.eu Full contact details at www.faunalia.eu/pc Nuovi corsi QGIS e PostGIS: http://www.faunalia.it/calendario ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] plugin dev - save to ogr vector file
On Wednesday, 4 July 2012, Paolo Cavallini cavall...@faunalia.it wrote: Il 03/07/2012 20:17, Rob Nickerson ha scritto: I am brand new to QGIS (having got here from my work with OpenStreetMap) so apologies if I am posting this in the wrong place. What I am trying to do is adapt the fTools plugin so that it can save to any ogr verctor file format. The reason behind this is that I found the ESRI shapefile format to be restrictive (e.g. attribute values are limited to 254 chars - 80 in QGIS??). that would be a very welcome addition, thanks. please note that fTools are now incorporated also in Sextante plugin. The plugin also saves by default in shp, but users can select other formats as well. could this solve your problem? all the best. -- Sounds like this solves my problem.:-) Is it worth spending a few moments to bring qgis online documentation up to date? I struggled to find the info I needed :-( rob Paolo Cavallini - Faunalia www.faunalia.eu Full contact details at www.faunalia.eu/pc Nuovi corsi QGIS e PostGIS: http://www.faunalia.it/calendario ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] plugin dev - save to ogr vector file
Il 04/07/2012 10:53, Rob Nickerson ha scritto: Sounds like this solves my problem.:-) Is it worth spending a few moments to bring qgis online documentation up to date? I struggled to find the info I needed :-( You're welcome to help :) All the best. -- Paolo Cavallini - Faunalia www.faunalia.eu Full contact details at www.faunalia.eu/pc Nuovi corsi QGIS e PostGIS: http://www.faunalia.it/calendario ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] plugin dev - save to ogr vector file
Correction: Sextante doesn't solve my problem as the fTools algorithms are still restricted to saving to ESRI shapefiles only (well the centroids algorithm I tested was). Rob On , Rob Nickerson rob.j.nicker...@gmail.com wrote: On Wednesday, 4 July 2012, Paolo Cavallini cavall...@faunalia.it wrote: Il 03/07/2012 20:17, Rob Nickerson ha scritto: I am brand new to QGIS (having got here from my work with OpenStreetMap) so apologies if I am posting this in the wrong place. What I am trying to do is adapt the fTools plugin so that it can save to any ogr verctor file format. The reason behind this is that I found the ESRI shapefile format to be restrictive (eg attribute values are limited to 254 chars - 80 in QGIS??). that would be a very welcome addition, thanks. please note that fTools are now incorporated also in Sextante plugin. The plugin also saves by default in shp, but users can select other formats as well. could this solve your problem? all the best. -- Sounds like this solves my problem.:-) Is it worth spending a few moments to bring qgis online documentation up to date? I struggled to find the info I needed :-( rob Paolo Cavallini - Faunalia www.faunalia.eu Full contact details at www.faunalia.eu/pc Nuovi corsi QGIS e PostGIS: http://www.faunalia.it/calendario ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] plugin dev - save to ogr vector file
It would be good if we could save the result of a fTools operation to a memory layer so you don't have to always write to the disk. You can always save to ogr layer from the Save as... After that too - Nathan Sent from some fancy phone looking thingo -- From: rob.j.nicker...@gmail.com Sent: 4/07/2012 7:54 PM To: cavall...@faunalia.it Cc: qgis-developer@lists.osgeo.org Subject: Re: [Qgis-developer] plugin dev - save to ogr vector file Correction: Sextante doesn't solve my problem as the fTools algorithms are still restricted to saving to ESRI shapefiles only (well the centroids algorithm I tested was). Rob On , Rob Nickerson rob.j.nicker...@gmail.com wrote: On Wednesday, 4 July 2012, Paolo Cavallini cavall...@faunalia.it wrote: Il 03/07/2012 20:17, Rob Nickerson ha scritto: I am brand new to QGIS (having got here from my work with OpenStreetMap) so apologies if I am posting this in the wrong place. What I am trying to do is adapt the fTools plugin so that it can save to any ogr verctor file format. The reason behind this is that I found the ESRI shapefile format to be restrictive (e.g. attribute values are limited to 254 chars - 80 in QGIS??). that would be a very welcome addition, thanks. please note that fTools are now incorporated also in Sextante plugin. The plugin also saves by default in shp, but users can select other formats as well. could this solve your problem? all the best. -- Sounds like this solves my problem.:-) Is it worth spending a few moments to bring qgis online documentation up to date? I struggled to find the info I needed :-( rob Paolo Cavallini - Faunalia www.faunalia.eu Full contact details at www.faunalia.eu/pc Nuovi corsi QGIS e PostGIS: http://www.faunalia.it/calendario ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] plugin dev - save to ogr vector file
Hi All, I am brand new to QGIS (having got here from my work with OpenStreetMap) so apologies if I am posting this in the wrong place. What I am trying to do is adapt the fTools plugin so that it can save to any ogr verctor file format. The reason behind this is that I found the ESRI shapefile format to be restrictive (e.g. attribute values are limited to 254 chars - 80 in QGIS??). So far Carson has kindly pointed me in the direction of the QGIS repo and I have exposed the other ogr formats in the save file dialog. This is where I get stuck. I can call QgsEncodingFileDialog().selectedNameFilter() to get the file name format however this is not compatible with the way QgsVectorFileWriter() works. The file writer requires the driver name as a format (e.g. ESRI Shapefile) whereas selectedNameFilter() returns the hard coded name in the save dialogues drop down box (e.g. ESRI Shapefiles [OGR] (*.shp *.SHP) ). Q: Is there an easy way to get just the driver name? - - - - - - - - - - - - - - - FYI I have looked at gdal tools. They set up a dictionary to be able to lookup any LONGNAME and return the driver name (SHORTNAME). The longnames are hard coded in the plugin and represent the QGIS save dialogues drop down format names (with the [OGR] and bracketed file extensions cut). The shortnames are the driver names from ogr. This code can be seen here: http://hub.qgis.org/projects/quantum-gis/repository/revisions/master/entry/python/plugins/GdalTools/tools/GdalTools_utils.py#L562 Although this should work, it would seem odd to have this hard coding in every plugin that wants to write to any ogr format!! Any ideas appreciated Regards, Rob ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer