[QGIS-Developer] Interrogation about algorithms to offset/translate features

DelazJ delazj at gmail.com
Wed Aug 22 19:58:50 PDT 2018

Hi Nyall and others,

Le mar. 21 août 2018 à 07:09, Nyall Dawson <nyall.dawson at gmail.com> a
écrit :

> On Mon, 20 Aug 2018 at 23:17, DelazJ <delazj at gmail.com> wrote:
> >
> > Good day devs,
> >
> > [...]
> >
> > I have some concerns/questions:
> >
> > -"translate" vs "array of offset features": why not just add the "number
> of features to create" parameter to the translate algorithm instead of
> having created a new one?
> > - "offset lines" vs "create parallel lines": same question as above, in
> favor of the offset lines algorithm
> My personal preference is to keep individual algorithms as simple as
> possible, and have additional algorithms covering similar use cases. I
> prefer this over the GRASS/SAGA algorithm approach of having one
> algorithm with a multitude of parameters which interact in different
> ways. In this case the algorithms have been separated into "vector
> creation" algorithms (array of offset features, create parallel lines)
> vs "geometry modification" algorithms (translate, offset lines).
> There's also the consideration that the vector creation algorithms
> also include the original feature by design - if you wanted to do this
> same thing by adding a "number of features" to the translate/offset
> lines algorithm, then you'd either need to add *another* parameter for
> "include original feature" OR require users to do some manual feature
> copy/pasting to append the original feature to the new table. Neither
> option is desirable in my view.
> OK, for some reasons I didn't notice that the "array of offset features"
also returned the original feature, hence my assumption that this behavior
in the "create parallel lines" was a bug and the differences between the
algs was only features multiplication. Makes sense to have different algs
in this case.

However I wonder if "number of features to create" is the appropriate
label; what about "number of copies to create" or "number of offsets to
create" given that when you enter 4, you get 5 features in the new layer
(including the original feature)? I'd expect 4 *features* as requested.

> [...]
> >   - Would that be possible to review the description and insert this
> homothetic idea so that people understand clearly that one do copy the same
> features and the other one may be different?
> Improving the algorithm's tags/short description/short help would
> always be appreciated!
> sure. Never doubt that. See https://github.com/qgis/QGIS/pull/7687
(reducing the use of the word "offset"). Hoping that i get what it's about
this time.

> > with less algs, there will be less translation to do and I hope less
> confusion around this concept.
> ...but I'm a strong -1 to squashing these operations into the same
> algorithm.
> See my above comment about having overlooked some features of the new
algs. When reading the algs description, the relation with the "single
featured" alg is not obvious to me; maybe reusing chunks of description
would have helped.
This comment was also for a general point of view: I don't know how it's
handled, but if we could try to reuse existing labels, this will reduce
translators and doc writers workload. A simple example (from memory, sorry)
"leave blank to use layer name" vs "leave empty to use layer name"

>   - and I still wonder if "create parallel lines" and "array of offset
> features" are not inverted names: in my mind, "array of offset features"
> sounds closer to "offset lines" than to "translate" which in turn is looks
> closer to "create parallel lines".
> I dislike the name "array of offset features", but it was the best one
> Mathieu and I could think of. Maybe it should be "array of translated
> features"/"array of offset lines"? I'd be happy to accept a PR giving
> them better names!
> My point here was that the alg that actually does the "parallel thingies"
is the so-called "array of offset features" and the "create parallel lines"
actually creates offset features.
I'm ok with the "array of tranlated features" to replace "array of offset
features". As said earlier, an offset geometry often seems to not be the
"same" geometry while this alg does keep it. Done in the aforementioned PR.

> - what about allowing polygons for the currently called "offset lines"
> and "create parallel lines" algs?
> Isn't that basically the same as buffer/multi-ring buffer (followed by
> taking the boundary of the result).
> Maybe in this order (would need to check the returned geometry) because
generating the boundary first (either with the 'boundary' or the 'polygon
to line' alg or drawing a closed linestring) then running the "create
parallel lines" or "offset lines" alg does not return a closed linestring
(which I think should be the expected result). Bug (should I file a
ticket?) or I again missed something?


> Nyall
> >
> > Regards,
> > Harrissou
> > _______________________________________________
> > QGIS-Developer mailing list
> > QGIS-Developer at lists.osgeo.org
> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180823/a70fcf0a/attachment.html>

More information about the QGIS-Developer mailing list