[Qgis-developer] python bindings, shapefile creation : attributes

kimaidou michael.douchin at laposte.net
Fri Nov 23 05:09:54 EST 2007


Hi,

First I would like to thank Martin Dobias for the well documented page :
http://wiki.qgis.org/qgiswiki/PythonBindings

I am coding a plugin to import a specific csv file and creating the
corresponding shapefile.
I have 2 questions relative to the attribute specification :
Q1) Are the date, time, datetime format usable for the attributes ? Like

# define fields for feature attributes
fields = { 0 : QgsField("date", QVariant.Date),
          1 : QgsField("time", QVariant.Time) }

I am pretty sure no. But then, how do people handle this type of data ? A
conversion to string type will cause the loose of "sort by date fonction"
(and so)

Q2) How can I tell the length and the precision of each attribute, so that
the shapefile won't be to heavy. For example, each string column is coded
with a length of 80, wich is space consuming.

Thanks in advance
Kimaidou 
-- 
View this message in context: http://www.nabble.com/python-bindings%2C-shapefile-creation-%3A-attributes-tf4860668.html#a13909676
Sent from the qgis-developer mailing list archive at Nabble.com.




More information about the Qgis-developer mailing list