<div dir="ltr">The function I am working with is the XY to Line utility which expects each record in the data to have two location points. This could be in the form of just a NoGeometry table with two coordinates as part of the fields or it could be a point layer with one of the points represented by the layer geometry and the other within the table data. I guess I will need to open it up to include Lines and Polygons, but I don't think the source of this data would ever be a line or polygon, but who knows what users may do.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 6, 2018 at 8:38 PM, Nyall Dawson <span dir="ltr"><<a href="mailto:nyall.dawson@gmail.com" target="_blank">nyall.dawson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">"<br>
On Sat, 7 Jul 2018 at 03:26, C Hamilton <<a href="mailto:adenaculture@gmail.com">adenaculture@gmail.com</a>> wrote:<br>
><br>
> I'm trying to convert one of my Shape Tools algorithms to a processing algorithm. My existing input layer either accepts a point vector layer or a NoGeometry table. I was guessing that the proper way to implement this is:<br>
><br>
> self.addParameter(<br>
>     QgsProcessingParameterFeatureS<wbr>ource(<br>
>         self.PrmInputLayer,<br>
>         'Input layer',<br>
>         [QgsProcessing.TypeFile, QgsProcessing.TypeVectorPoint]<wbr>)<br>
> )<br>
><br>
> TypeFile seems to do nothing. It certainly does not show the CSV file I have loaded that has no geometry. It filters the files so that only point layers are available. Interestingly if I use just TypeFile it seems to select all vector layer types.<br>
<br>
</span>TypeFile is not correct here - from the docs, TypeFile = "Files (i.e.<br>
non map layer sources, such as text files)". There's actually no way<br>
to show only Point layers OR Geometry-less tables. The closest is<br>
TypeVector, which will show all vector sources, including<br>
points/line/polygons AND no geometry tables.<br>
<br>
But -- I'd question why you'd want to restrict your algorithm inputs<br>
to Point/NoGeometry only in the first place. If your algorithm can<br>
work with NoGeometry tables, it should also work with inputs with<br>
Lines and Polygon geometries, and just ignore those. Otherwise you're<br>
putting an artificial limitation on the inputs which can be used,<br>
which is sure to annoy users somewhere down the line!<br>
<span class="HOEnZb"><font color="#888888"><br>
Nyall<br>
</font></span></blockquote></div><br></div>