[Qgis-user] Export to vector layer to CSV with coordinates

Václav Řehák rehakv01 at gmail.com
Mon Feb 28 04:14:37 PST 2011


Dne 27. února 2011 3:54 Goyo <goyodiaz at gmail.com> napsal(a):
> 2011/2/25 Václav Řehák <rehakv01 at gmail.com>:
>> Hi list,
>>
>> is there a way how to export vector layer to a csv file including the
>> coordinates? The "Save as..." - "Comma Separated Value" command
>> exports only the attributes but my users would like to export the
>> data, perform some processing (such as filtering) in Excel and load
>> the data as a new layer.
>
> This is what I do. Select the features in QGIS, copy, paste into your
> spreadsheet app. The geometries are pasted as WKT in the first column.
> Use "Text to columns" feature (this depends on your app) if you want
> the coordinates as numbers. This works only for points and shouldn't
> be necessary since the text import plugin seems to understand WKT. Do
> your stuff, then select all cells, copy and paste into a text file for
> use with QGIS.

Thanks, this is exactly what I was looking for.

> This is indeed a terrible idea for data integrity but if you work with
> shapefiles, dbf and text files you haven't got data integrity anyway.

I understand the integrity problem. On the other hands, I have just a
few users, they only work with points and QGIS is just a small
fraction of their workflow so I try to keep their interactions with
QGIS as limited as possible.

For instance, one of the shapefile layers has datetime attribute in
the format required by Timemanager plugin (text string like
"2011-02-28 14:25") and using QGIS only it is user unfriendly to do
things like "filter only points in the afternoon". Not mentioning that
if you add query to a layer, you can no longer edit the features.

I know that db would be solution for most of this problems but if the
users are used to work with spreadsheet (and exchange them by e-mail,
etc.), I think this might be more acceptable for them.


Alex Mandel wrote
> Suggestions would also be welcome on how to improve the QGIS interface to make this easier for users.

For my use case it would be to add option to save as text file with
WKT column :)

And in general, I would need better date & time based filtering for
shapefiles, which is currently limited by the absence of "datetime"
attribute type in shapefiles (due to OGR limitations IMHO).

Vaclav



More information about the Qgis-user mailing list