I'm trying to use pyProj to convert UTM coordinates from WGS84 UTM 30N (epsg 36230) to ED50 (epsg 23030).
My WGS 85 coordinate is 456859.248 E, 6212329.347 N. When I convert using this online convertor [https://tool-online.com/en/coordinate-converter.php] I should get this: 456961.342 E, 6212551.085 N. Instead I get this: 456959.3405 E, 6212550.44 N, which as you can see is around 2 metres from where it should be.
In my code, I import a simple CSV with two columns called 'Easting' and 'Northing'. The CSV has one row which is the Easting and Northing values I posted above.
CODE BELOW
import pandas as pd
from pyproj import Transformer
class Transform:
def __init__(self, in_epsg, out_epsg, input_file):
self.in_epsg = in_epsg
self.out_epsg = out_epsg
self.transformer = Transformer.from_crs(f"epsg:{self.in_epsg}", f"epsg:{self.out_epsg}")
self.df = pd.read_csv(input_file)
self.x_list, self.y_list = [], []
def iterate_rows(self, column1, column2):
for index, row in self.df.iterrows():
x = (row[column1])
y = (row[column2])
x_new, y_new = self.transformer.transform(x, y)
self.x_list.append(x_new)
self.y_list.append(y_new)
self.df[f'Easting_converted'], self.df[f'Northing_converted'] = self.x_list, self.y_list
self.df.to_csv('converted.csv')
test = Transform(32630, 23030, 'small.csv')
test.iterate_rows('Easting', 'Northing')