Hi Nicolas,

Il giorno dom 1 gen 2023 alle ore 04:53 Nicolas Cadieux <
njacadieux.git...@gmail.com> ha scritto:

> 
>
> Try decimal with commas. Check your local system settings.  Could this be
> a wrong CRS problem?  Try zoom to layer extent to see if they pop up in the
> wrong place.  Share a few examples so we can check. Try  exporting the
> geometries to Wkt in a new field to see what happens….
>

Thank you for your suggestions, particularly the "geom_to_WKT", it let me
discover problem.
IMHO this is a bug in "geometry by expression" algorithm.

By my exoeriences, this algorithm works _only_ if source layer has at
almost one feature.
If so, you can add new feature by this expression:
make_point(to_real(@Long),to_real(lat))
where @Long and @Lat are two project variables. Everything works as
expected.

Otherwise, e.g. when the source layer has no feature (empty layer), the
geometry by expression fails and return <null> geometry, even if the
preview in expression generator is correct.

In my test, i was usual to truncate the source layer before generate new
geometry.
This caused the fail of geometry by expression algorithm.

Instead, if i don't truncate source layer (and it has at almost one
geometry before running the model), then the algorithm works.

This is a bit confusing, because in the  "geometry by expression"
documentation there is no reference to this condition.
Could this be a bug?
Is it possible to add new features to a empty layer with geometry by
expression?

Again, thank you to everyone and have a nice year!

Francesco
_______________________________________________
QGIS-User mailing list
QGIS-User@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to