[Qgis-developer] morph delimited-text-provider to generic table-provider?

Chris Crook ccrook at linz.govt.nz
Mon Jul 11 00:00:59 PDT 2016


Hi All

Intriguing idea.

I would be reluctant to have the DL provider any more cumbersome as it serves very well for very quick visualisation of data exported by other programs/scripts.

OTOH the dialog for creating delimited text layers is very clumsy - it has a lot to do in one screen and still doesn't do everything we might want (eg selecting CRS).   The dialog does split very naturally into two parts, one defining the data source (ie filename, encoding, delimiters, headers, etc), and the second half defining the mapping of columns to geometry definition.  One option might be to more explicitly break it up, putting the geometry definition into a separate widget, which could be either be included in current window or placed in something more like a tabbed dialog or wizard type dialog (whatever fits best in QGIS).  With a bit of care the geometry definition widget and functions (eg testing data source for candidate geometry fields) could be encoded into a reusable widget that could be reused with other data sources.

Not sure how the implementation would go - it could be useful to implement as a virtual field, but how would this get encoded into URL and how would manual changes to field be managed.

Anyway, certainly an idea worth considering!

Cheers
Chris
________________________________________
From: Qgis-developer [qgis-developer-bounces at lists.osgeo.org] On Behalf Of Neumann, Andreas [a.neumann at carto.net]
Sent: 11 July 2016 18:41
To: richard at duif.net
Cc: qgis-developer
Subject: Re: [Qgis-developer] morph delimited-text-provider to generic table-provider?

Hi,

I would welcome an "easier" way to open Point or WKT data from formats that do not store geometries natively, as you propose. Thanks for bringing it to the table, Raymond and Richard!

My suggestion would be to enhance the existing OGR "Add vector layer" dialog with an option to choose columns to be used for geometry creation. This way we don't have to "misuse" the delimited text layer loader for other formats and the user could open the data all in one step, without the need for postprocessing. OGR VRT provides all we need to create geometries from columns - see http://www.gdal.org/drv_vrt.html

The drawback is that it would work only for OGR formats, not for all the other databases. But I would assume that people using databases are skilled enough to be able to use QGIS virtual layers, views, etc. to build geometries from their databases.

Greetings,
Andreas

On 2016-07-09 11:00, Richard Duivenvoorde wrote:

Hi Devs,

Raymond Nijssen had an (I think) intriguing idea:

QGIS can open different types of table-data: dbf, excel etc etc

But if the excel contains an x,y,wkt column, you have to save it to
csv/tsv first, to be able to use the delimited-text-provider to open it
as a layer.

His idea: can't we use the delimited-text-provider for all tables that
are open in QGIS immediately?

Had a look into the code

https://github.com/qgis/QGIS/blob/master/src/providers/delimitedtext/qgsdelimitedtextfile.cpp#L583

which 'just' looks like a QTextStream:

https://github.com/qgis/QGIS/blob/master/src/providers/delimitedtext/qgsdelimitedtextfile.h#L352

And according to this:
https://forum.qt.io/topic/63310/how-to-save-a-treeview-as-csv-file-in-qt

It is easy to create a textstream from QModel (in which we have the data
I think???)...

So Question:
- (to devs): would this indeed be doable/easy?
- (to UI's): should the Delimited Text File dialog be updated then (or
only with a 'open excisting table button'?
- should we rename the provider to 'table' provider.

Comments/Opinions?

Regards,

Richard Duivenvoorde
_______________________________________________
Qgis-developer mailing list
Qgis-developer at lists.osgeo.org<mailto:Qgis-developer at lists.osgeo.org>
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer





This message contains information, which may be in confidence and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info at linz.govt.nz) and destroy the original message. LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ. Thank You.


More information about the Qgis-developer mailing list