0

so i have a database of X and Y coordinates as the ITM type and i want it as WGS-84 type. i found a function from pyproj library thats convert and it works great but now i'm having troubles to apply this function on two separate columns.

for example i want to convert this data :

Column x Column y
643234 234562
634352 434534

to something like that

Column X Column Y
33.04647 35.56525
25.34533 23.43532

so my function accepts two arguments(X from Column x and Y from column y) and needs to replace all the values to the new coordinates data any one has an idea how to use the apply function to work on both columns

i tried to use apply function on both column but it didn't worked out and i couldn't find a solution online and i also tried to change my Function to work separately on one column but its impossible because its a built in function of a certain library

Chubix34
  • 3
  • 1

1 Answers1

0

https://github.com/geopandas/geopandas/issues/1400

from pyproj import Transformer

trans = Transformer.from_crs(
    "epsg:4326",
    "+proj=utm +zone=10 +ellps=WGS84",
    always_xy=True,
)
xx, yy = trans.transform(My_data["LON"].values, My_data["LAT"].values)
My_data["X"] = xx
My_data["Y"] = yy
snowman2
  • 646
  • 4
  • 11