<div dir="ltr">Hi, <div>I have had that in mind for quite a while now:</div><div>- non spatial datasources that can be spatialized with XY / WKT  or adress geocoding. </div><div>- Those non spatial datasources are most of the time untyped datasources. Some try to autotype like Excel, some not like CSV. </div><div><br></div><div>Delimited text provider handles the text file sources, is very mature now, except on casting some string to numeric types. </div><div>We also have OGR access to all text / excel / ods files. It works quite well, especially with xlsx, and other formats storing some information on data type. But we have no UI to help user choosing field format like in all other softwares (excel/ calc / access...). </div><div>That situation leads to some cumbersome troubles like virtual layers trying to access delimited text as OGR datasource, when sometimes it comes from delimited text provider plugin. Obviously, this lead to a failing query. Users also get confused too by those two datasource, each one stll with drawbacks</div><div><br></div><div>What I had in mind was funding the unification of vector/spreadsheet datasource GUI, and merge delimited text provider as a frontend to ogr csvt / vrt.  Nathan's old mockups were very interesting because we had an overview of data and a UI to help user choose types / delimiters / encoding, XY - WKT field. </div><div><br></div><div>Dragging a csv to QGIS woould then open that window to help importation. </div><div><br></div><div>Adding some memory of import schemas by file name could also gain a lot a clicks also so that importing csv with same column names could assume using last user choices and not default typing.  Anyway, not asking user for a schema like excel does is a total mistake we must not reproduce. </div><div><br></div><div>We could maybe use the geometry generator, but if we do that, I'm afraid that virtual layers seeing datasource through OGR will not see spatial columns and lead to cumbersome failures. Many algorithms may also be entroubled there. </div><div><br></div><div>I still see a drawback in ogr vrt / csvt approach, the same as Mapinfo back in the old times, is that when user has readonly rights on the datasource, vrt/csvt must be stored elsewhere that along the source file.  If we want a user to be able to share the qgs project, I see no other places than the qgs itself, and a mecanism to have OGR and virtual layers work seamlessly with that. </div><div><br></div><div>My vote is then for a pure core way, not another plugin, with close discussion with OGR-GDAL so that any tool sees datasources the same way in QGIS. QGIS will do his part with a super easy import-preview window, pretty close from current delimited text provider. </div><div><br></div><div>Unfortunately, I won't be able to fund that  since I'm leaving my job to go working with Oslandia team ! If we agree on a plan, I'll try to convince some funders :))</div><div><br></div><div>Régis</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-07-09 11:44 GMT+02:00 Matthias Kuhn <span dir="ltr"><<a href="mailto:matthias@opengis.ch" target="_blank">matthias@opengis.ch</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <p>Hi,</p>
    <p>I think there are already 2 possibilities to show x,y /wkt or
      other geometries for any kind of layers</p>
    <p> * Geometry generators</p>
    <p> * Virtual layers (no expert, but I guess that's possible)<br>
    </p>
    So at least read-only this should be straightforward, read-write
    maybe with virtual layers (?).<br>
    <br>
    Matthias<div><div class="h5"><br>
    <br>
    <div>On 07/09/2016 11:34 AM, Raymond Nijssen
      wrote:<br>
    </div>
    <blockquote type="cite">
      <pre>Great idea! ;)

Question is where to implement it in the GUI. It overlaps the
functionality in the delimited text reader. Like pointing to the x and y
columns or choosing a column containing wkt.

Maybe it could be a 2 steps process? Step 1 is importing any table and
step 2 is creating a spatial layer from it. But we would loose the quick
"Add delimited text layer" functionality.

Any ideas?

@Paolo, which plugin can do this? XyTools?

Regards,
Raymond




On 09-07-16 11:14, Paolo Cavallini wrote:
</pre>
      <blockquote type="cite">
        <pre>Agreed. There is a plugin doing this, but of course having it as a
standard function is desirable.
Thanks for raising this.

Il 9 luglio 2016 12:00:38 EEST, Richard Duivenvoorde
<a href="mailto:rdmailings@duif.net" target="_blank"><rdmailings@duif.net></a> ha scritto:

    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

    <a href="https://github.com/qgis/QGIS/blob/master/src/providers/delimitedtext/qgsdelimitedtextfile.cpp#L583" target="_blank">https://github.com/qgis/QGIS/blob/master/src/providers/delimitedtext/qgsdelimitedtextfile.cpp#L583</a>

    which 'just' looks like a QTextStream:

    <a href="https://github.com/qgis/QGIS/blob/master/src/providers/delimitedtext/qgsdelimitedtextfile.h#L352" target="_blank">https://github.com/qgis/QGIS/blob/master/src/providers/delimitedtext/qgsdelimitedtextfile.h#L352</a>

    And
    according to this:
    <a href="https://forum.qt.io/topic/63310/how-to-save-a-treeview-as-csv-file-in-qt" target="_blank">https://forum.qt.io/topic/63310/how-to-save-a-treeview-as-csv-file-in-qt</a>

    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
    <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a>
    List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
    Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a>


-- 
Paolo Cavallini
<a href="http://www.faunalia.eu" target="_blank">www.faunalia.eu</a> <a href="http://www.faunalia.eu" target="_blank"><http://www.faunalia.eu></a>


_______________________________________________
Qgis-developer mailing list
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a>

</pre>
      </blockquote>
      <pre>_______________________________________________
Qgis-developer mailing list
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a></pre>
    </blockquote>
    <br>
    </div></div><span class="HOEnZb"><font color="#888888"><pre cols="72">-- 
Matthias Kuhn
OPENGIS.ch - <a href="https://www.opengis.ch" target="_blank">https://www.opengis.ch</a>
Spatial • (Q)GIS • PostGIS • Open Source</pre>
  </font></span></div>

<br>_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Régis Haubourg<br><br>Attention, changement d'adresse mail! <br>Mon adresse principale devient désormais regis.haubourg at <a href="http://gmail.com" target="_blank">gmail.com</a><br><br></div>
</div>