[Qgis-developer] Add virtual layer equivalent in Processing
Anita Graser
anitagraser at gmx.at
Mon Dec 5 09:16:04 PST 2016
Thanks Victor!
On Mon, Dec 5, 2016 at 1:54 PM, Victor Olaya <volayaf at gmail.com> wrote:
> Anita, Mathieu
>
> I added both of your requests and it should be possible now to use
> tables on both "execute SQL" and "build virtual vector" algorithms
>
> Let me know if you try it (it is on master)
>
As far as I can see OGR's Execute SQL takes only one input layer/table.
Therefore it's not suitable for the task of joining a vector layer with a
table.
QGIS' Build virtual vector takes multiple inputs but I'm not sure what it
does with them. The help text is a bit short: "This algorithm creates a
virtual layer that contains a set of vector layer." That does not sound
like it will do the job either.
QGIS' Execute SQL seems to allow multiple inputs but doesn't list tables
and I didn't see any changes to this algorithm in your recent commits but
maybe I missed something?
Note: I'm running qgis-dev from OSGeo4W which is probably not up to date
with master.
The SQL statement I want to execute (and which runs well in Layer | Add
Layer | Add Virtual Layer) is:
select s_out.y1_statefips, s_out.y2_statefips,
st_centroid(f.geometry)
from fips as f
join stateoutflow1415 as s_out
on f.fips = s_out.y1_statefips
where fips is a polygon layer and stateoutflow1415 is a CSV.
Best wishes,
Anita
>
> Cheers
>
> 2016-12-05 11:07 GMT+01:00 Mathieu Pellerin <nirvn.asia at gmail.com>:
> > Victor,
> >
> > I was looking into this; it'd be nice for the "build vector layer"
> algorithm
> > would support/show geometryless layers in the parametermultiinput panel.
> > AFAIK, geometryless layers aren't (yet? :) ) supported by the
> > parametermultiinput.
> >
> > Math
> >
> > On Mon, Dec 5, 2016 at 2:51 PM, Victor Olaya <volayaf at gmail.com> wrote:
> >>
> >> No, there is no such functionality AFAIK, but it should be easy to add,
> i
> >> think
> >>
> >> Can you open a feature request?
> >>
> >> Also, the execute SQL algorithm can be modified to accept non-spatial
> >> tables. That makes sense to me
> >>
> >> Cheers
> >>
> >> 2016-12-04 22:28 GMT+01:00 Anita Graser <anitagraser at gmx.at>:
> >> > Hi,
> >> >
> >> > Since the user list doesn't seen to have an answer, I'd like to ask
> >> > here:
> >> > Is there an equivalent to the "add virtual layer" functionality in the
> >> > Processing toolbox?
> >> >
> >> > I want to join multiple csv files to a vector layer (and at the same
> >> > time
> >> > build a new geometry WKT). This seems most easily done with a virtual
> >> > layer.
> >> > But I need to script this workflow.
> >> >
> >> > In the Processing toolbox, I only found the "execute SQL" tool but it
> >> > does
> >> > not allow selection of non-spatial tables as input.
> >> >
> >> > Best wishes,
> >> > Anita
> >> >
> >> >
> >> >
> >> > _______________________________________________
> >> > Qgis-developer mailing list
> >> > 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
> >> _______________________________________________
> >> Qgis-developer mailing list
> >> 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
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20161205/a62ab26a/attachment.html>
More information about the Qgis-developer
mailing list