# Perspective map component - lat/long transformation

**URL:** <https://forum.inductiveautomation.com/t/perspective-map-component-lat-long-transformation/57097>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 11, 2022, 9:32am UTC](https://forum.inductiveautomation.com/t/perspective-map-component-lat-long-transformation/57097 "2022-03-11T09:32:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aravindan.s](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@aravindan.s](https://forum.inductiveautomation.com/u/aravindan.s)\
**Post date:** [March 11, 2022, 9:32am UTC](https://forum.inductiveautomation.com/t/perspective-map-component-lat-long-transformation/57097/1 "2022-03-11T09:32:03Z")

</div>

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?

Thanks,  
Aravindan.S

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 11, 2022, 5:38pm UTC](https://forum.inductiveautomation.com/t/perspective-map-component-lat-long-transformation/57097/2 "2022-03-11T17:38:22Z")

</div>

> [@aravindan.s](#):
>
> Is there a way to make python libraries developed in v3 work in ignition?

No.

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](https://github.com/dstl/osgb) 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.

---

<div class="post-metadata">

**Author:** ![Sushant\_Ukande](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@Sushant\_Ukande](https://forum.inductiveautomation.com/u/Sushant_Ukande)\
**Post date:** [March 27, 2023, 12:04pm UTC](https://forum.inductiveautomation.com/t/perspective-map-component-lat-long-transformation/57097/3 "2023-03-27T12:04:20Z")

</div>

Hi  
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](https://github.com/dstl/osgb)  
I have tried to paste library in this path(Ignition-\>user-lib-\>pylib).

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/6/f607b0f09d6befada77ad1bc7e30c6b8ec89b8bf.png)

Can you please assist here?  
Regards,  
Sushant

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 27, 2023, 12:21pm UTC](https://forum.inductiveautomation.com/t/perspective-map-component-lat-long-transformation/57097/4 "2023-03-27T12:21:11Z")

</div>

> [@Sushant\_Ukande](#):
>
> paste library in this path(Ignition-\>user-lib-\>pylib).

That wasn't Paul's advice:

> [@paul-griffith](#):
>
> and install it into Ignition via a custom module

or

> [@paul-griffith](#):
>
> somewhat hacky: You can also drop a .jar file into the right location on the gateway’s filesystem

Which would be `lib/common`, most likely.
