[Qgis-user] Adding Field Calculator Functions - Best Practices / Avoiding Name Conflicts

C Hamilton adenaculture at gmail.com
Wed Sep 16 08:55:14 PDT 2020


Greetings,

Because of a user request I have been starting to expose Lat Lon Tools
coordinate format conversion functions. I found out today that if you
accidentally call one of your functions the same name as one of the
existing functions, it causes QGIS to crash immediately. It got me thinking
about the best practices for releasing field calculator functions. As other
developers create their own field calculator functions there is the
potential for major problems. I would say that if there is a name conflict
it shouldn't crash QGIS.

These are the function names I currently have in Lat Lon Tools.

mgrs, mgrs_100km, mgrs_east, mgrs_north, mgrs_to_point

Here are additional function names I have added that have not yet been
uploaded to the QGIS plugin repo and more are on the way

utm, utm_epsg, utm_hemisphere, utm_to_point, utm_zone, dms, ddmmss

I like simple function names, but because of concerns that there could be
name conflicts with other QGIS plugin developers I am wondering if a plugin
name prefix should be added such as ll_mgrs for the Lat Lon Tools mgrs
conversion function.

What are your thoughts?

Thanks,

Calvin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20200916/8ccee3d2/attachment.html>


More information about the Qgis-user mailing list