Perspective map component - lat/long transformation

Hi All,

I am working on Map component and i want to convert latitude and longitude value that i get in event scripts into British national grid value i.e WGS 84 coordinate system to “PSG:27700 OSGB 1936 / British National Grid” coordinate system.

I tried to accomplish this using 3rd part python libraries like “convertbng” and “proj4” libraries, but it failed due to python version limitations.

Please suggest a method to solve this issue
Is there a way to make python libraries developed in v3 work in ignition?



You can either:
A: Install a CPython environment with the required dependencies, separate from Ignition, and have Ignition call a Python process to translate your coordinates and return the values. I wouldn’t recommend this, but it’s possible. You could do it directly by launching a process, or stand up a mini-webserver (e.g. bottle, flask), or any other means of inter-process-communication you want.
B: Obtain a Java library that can do the required translation, e.g. GitHub - dstl/osgb: Library for converting between OSGB and WGS84 coordinates and install it into Ignition via a custom module. If you go this route, you could pretty easily expose the functionality provided by the Java code as a script in Ignition, e.g. system.coords.convertToBng(). This would be ideal both for performance and ease-of-use.
C: Undocumented, somewhat hacky: You can also drop a .jar file into the right location on the gateway’s filesystem and it will automatically be detected and usable from Ignition on the next startup. You would have to call the Java code directly from your Python environment, which might require some extra steps, but this would be just as performant as the scripting method, just harder to use.


I am not getting this solution and facing issue like this module is not available.GitHub - dstl/osgb: Library for converting between OSGB and WGS84 coordinates
I have tried to paste library in this path(Ignition->user-lib->pylib).

Can you please assist here?

That wasn't Paul's advice:


Which would be lib/common, most likely.