Thanks Greg. That sounds nice and easy! I must be missing something
though as it doesn't seem to be working quite right...
The code I am using is as follows:
Declare Sub Main
Sub Main
Print "----------------------------------------------"
Print "EPSG:27700 = " & EPSGToCoordSysString$("EPSG:27700")
Print "EPSG:3857 = " & EPSGToCoordSysString$("EPSG:3857")
' Set coord sys to EPSG:27700 and save coords (1)
run command("Set " + EPSGToCoordSysString$("EPSG:27700"))
Update test1 set xref_1 = CentroidX(Obj)
Update test1 set yref_1 = CentroidY(Obj)
' set to EPSG:3857 and save coords (2)
Run command("Set " + EPSGToCoordSysString$("EPSG:3857"))
Set Map XY Units "degree" ' No effect - see comments
below...
Update test1 set xref_2 = CentroidX(Obj)
Update test1 set yref_2 = CentroidY(Obj)
Note "done."
End Sub
xref_1 and yref_1 are populated correctly. (values are in the region
of 348,000, 175,000).
xref_2 and yref_2 should be roughly 51.5, -2.6. However they are off
by a long way (-314,193.85, 6,706,415.24). By the look if they are
still in meters rather than degrees. The only way I can see of
changing the coordinate units to degrees is with "Set Map" which
doesn't appear to have any effect.
Any ideas?
Thanks again