[Qgis-developer] Python CSV Plugin

Tim Sutton lists at linfiniti.com
Wed Dec 29 04:40:11 EST 2010


Hi Jude


On Wed, Dec 29, 2010 at 9:11 AM, jude mwenda <judemwenda at gmail.com> wrote:
> Hi all,
>
> I have been building a plugin and reached a dead end. I am parsing the csv
> resource into a variable. but according to the qgis documentation, the
> resource has to be a file. Can it be a variable. the code section that has
> this issue is
>     results = ft_client.query(SQL().select(371443,None,None))
>
>     uri = results."?delimiter=%s&xField=%s&yField=%s" % (",", "Address",
> "LONGITUDE")
>     vlayer = QgsVectorLayer(uri, "layer_name_you_like", "delimitedtext")
> there is something very wrong with the uri section of the code. the docs
> just use file paths, what of a variable as is my case? How would i go about
> loading this. Please help


Possibly your issue arises from the fact that you cannot perform sql
type queries on delimited text layers. Try add a delimited layer to
QGIS interactively and you will see the Layer->Query option for that
layer is disabled.

Regards

Tim

> --
> Regards,
>
> Jude Mwenda
> Skype id: jmwenda
> Twitter: www.twitter.com/judemwenda
>
> "Was ist mein Leben, wenn ich nicht mehr nützlich für andere."
> Johann Wolfgang von Goethe
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>



-- 
Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
==============================================
Please do not email me off-list with technical
support questions. Using the lists will gain
more exposure for your issues and the knowledge
surrounding your issue will be shared with all.

Visit http://linfiniti.com to find out about:
 * QGIS programming and support services
 * Mapserver and PostGIS based hosting plans
 * FOSS Consulting Services
Skype: timlinux
Irc: timlinux on #qgis at freenode.net
==============================================


More information about the Qgis-developer mailing list