[QGIS-Developer] geom_from_text() and GeomFromWKT()

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[QGIS-Developer] geom_from_text() and GeomFromWKT()

Raymond Nijssen
In a qgis expression both

   geom_from_wkt('point(0 0)')

and

   GeomFromWKT('point(0 0)')

work!


The first is listed in the expression functions but the second is not.
It is not a problem but it surprises me and I'm wondering if there are
more secret functions in expressions. Does anyone know?

Kind regards,
Raymond
_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: geom_from_text() and GeomFromWKT()

Matthias Kuhn 🌍
Yes, there are several aliases for existing functions defined.

[print(f.name() + ' -> ' + str(f.aliases())) for f in
QgsExpression.Functions() if f.aliases()]

pi -> ['$pi']
to_int -> ['toint']
to_real -> ['toreal']
to_string -> ['tostring']
to_datetime -> ['todatetime']
to_date -> ['todate']
to_time -> ['totime']
to_interval -> ['tointerval']
to_dm -> ['todm']
to_dms -> ['todms']
now -> ['$now']
$x_at -> ['xat', 'x_at']
$y_at -> ['yat', 'y_at']
x_min -> ['xmin']
x_max -> ['xmax']
y_min -> ['ymin']
y_max -> ['ymax']
geom_from_wkt -> ['geomFromWKT']
geom_from_gml -> ['geomFromGML']
intersects_bbox -> ['bbox']
convex_hull -> ['convexHull']
sym_difference -> ['symDifference']
geom_to_wkt -> ['geomToWKT']
uuid -> ['$uuid']
get_feature -> ['QgsExpressionUtils::getFeature']


Regards
Matthias

On 11/29/19 2:31 PM, Raymond Nijssen wrote:

> In a qgis expression both
>
>   geom_from_wkt('point(0 0)')
>
> and
>
>   GeomFromWKT('point(0 0)')
>
> work!
>
>
> The first is listed in the expression functions but the second is not.
> It is not a problem but it surprises me and I'm wondering if there are
> more secret functions in expressions. Does anyone know?
>
> Kind regards,
> Raymond
> _______________________________________________
> QGIS-Developer mailing list
> [hidden email]
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: geom_from_text() and GeomFromWKT()

Raymond Nijssen
Aha, thank you!



On 29-11-19 15:22, Matthias Kuhn wrote:

> Yes, there are several aliases for existing functions defined.
>
> [print(f.name() + ' -> ' + str(f.aliases())) for f in
> QgsExpression.Functions() if f.aliases()]
>
> pi -> ['$pi']
> to_int -> ['toint']
> to_real -> ['toreal']
> to_string -> ['tostring']
> to_datetime -> ['todatetime']
> to_date -> ['todate']
> to_time -> ['totime']
> to_interval -> ['tointerval']
> to_dm -> ['todm']
> to_dms -> ['todms']
> now -> ['$now']
> $x_at -> ['xat', 'x_at']
> $y_at -> ['yat', 'y_at']
> x_min -> ['xmin']
> x_max -> ['xmax']
> y_min -> ['ymin']
> y_max -> ['ymax']
> geom_from_wkt -> ['geomFromWKT']
> geom_from_gml -> ['geomFromGML']
> intersects_bbox -> ['bbox']
> convex_hull -> ['convexHull']
> sym_difference -> ['symDifference']
> geom_to_wkt -> ['geomToWKT']
> uuid -> ['$uuid']
> get_feature -> ['QgsExpressionUtils::getFeature']
>
>
> Regards
> Matthias
>
> On 11/29/19 2:31 PM, Raymond Nijssen wrote:
>> In a qgis expression both
>>
>>   geom_from_wkt('point(0 0)')
>>
>> and
>>
>>   GeomFromWKT('point(0 0)')
>>
>> work!
>>
>>
>> The first is listed in the expression functions but the second is not.
>> It is not a problem but it surprises me and I'm wondering if there are
>> more secret functions in expressions. Does anyone know?
>>
>> Kind regards,
>> Raymond
>> _______________________________________________
>> QGIS-Developer mailing list
>> [hidden email]
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
> _______________________________________________
> QGIS-Developer mailing list
> [hidden email]
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer