Hi David
This does indeed look a bit weird.
I tried with a more simple version of your code and just printed the coordinates of the moved point:
set coordsys Earth Projection 8, 79, "m", -2, 49, 0.9996012717, 400000, -100000 Bounds (1, 1) (680000, 1250000)
dim o1 as object
dim o2 as object
o1 = createpoint(100000,100000)
o2 = o1
Print "1. " + FormatNumber$(Round(CentroidX(o2), 1)) + " | " + FormatNumber$(Round(CentroidY(o2), 1))
o2 = cartesianoffsetXY(o2,0,300000,"m")
Print "2. " + FormatNumber$(Round(CentroidX(o2), 1)) + " | " + FormatNumber$(Round(CentroidY(o2), 1))
o2 = cartesianoffsetXY(o2,0,300000,"m")
Print "3. " + FormatNumber$(Round(CentroidX(o2), 1)) + " | " + FormatNumber$(Round(CentroidY(o2), 1))
o2 = cartesianoffsetXY(o2,0,300000,"m")
Print "4. " + FormatNumber$(Round(CentroidX(o2), 1)) + " | " + FormatNumber$(Round(CentroidY(o2), 1))
o2 = cartesianoffsetXY(o2,0,300000,"m")
Print "5. " + FormatNumber$(Round(CentroidX(o2), 1)) + " | " + FormatNumber$(Round(CentroidY(o2), 1))
This is the result from the Message window:
1. 100,000 | 100,000
2. 100,000 | 199,999
3. 100,000 | 399,997
4. 100,000 | 699,997
5. 100,000 | 999,997
Notice that I tried moving the point 4 times and that it actually seems to "pick up speed".
For the first Offset, it's only moved 99,999 meters. Next time it's moved 199,998 meters, and the last two times it's moved the specified 300,000 meters
I also tried using the
cartesianOffset
function where you specify a direction and a distance.
set coordsys Earth Projection 8, 79, "m", -2, 49, 0.9996012717, 400000, -100000 Bounds (1, 1) (680000, 1250000)
dim o1 as object
dim o2 as object
o1 = createpoint(100000,100000)
o2 = o1
Print "1. " + FormatNumber$(Round(CentroidX(o2), 1)) + " | " + FormatNumber$(Round(CentroidY(o2), 1))
o2 = Cartesianoffset(o2,90,300000,"m")
Print "2. " + FormatNumber$(Round(CentroidX(o2), 1)) + " | " + FormatNumber$(Round(CentroidY(o2), 1))
o2 = Cartesianoffset(o2,90,300000,"m")
Print "3. " + FormatNumber$(Round(CentroidX(o2), 1)) + " | " + FormatNumber$(Round(CentroidY(o2), 1))
o2 = Cartesianoffset(o2,90,300000,"m")
Print "4. " + FormatNumber$(Round(CentroidX(o2), 1)) + " | " + FormatNumber$(Round(CentroidY(o2), 1))
o2 = Cartesianoffset(o2,90,300000,"m")
Print "5. " + FormatNumber$(Round(CentroidX(o2), 1)) + " | " + FormatNumber$(Round(CentroidY(o2), 1))
This works more stable until the point reaches the boundary at 1,250,000:
1. 100,000 | 100,000
2. 100,000 | 400,000
3. 100,000 | 700,000
4. 100,000 | 1,000,000
5. 100,000 | 1,250,000
I'll pass this onto our support so that we can get engineering looking at this.
------------------------------
Peter Horsbøll Møller
Distinguished Engineer
Pitney Bowes Software & Data
------------------------------
Original Message:
Sent: 04-09-2020 09:47
From: David Wilson
Subject: There seems to be a distance limit to the CartesianOffsetXY function
Hi John
I do not think so. I've tried doing it manually in the MapInfo MapBasic window as below and the points do not appear at the correct location.
But my previous post altering the nodes works ok.
set coordsys Earth Projection 8, 79, "m", -2, 49, 0.9996012717, 400000, -100000 Bounds (1, 1) (680000, 1250000)
set distance units "m"
dim o as object
dim cosmo as string
cosmo = windowinfo(frontwindow(),10)
o = createpoint(100000,100000)
o = cartesianoffsetXY(o,0,300000,"m")
insert into cosmo (obj) values (o)
Set Map Center (100000, 200000)
Cheers
David
------------------------------
David Wilson
Buchanan Computing
London, UK
Original Message:
Sent: 04-09-2020 09:04
From: John Ievers
Subject: There seems to be a distance limit to the CartesianOffsetXY function
Hi David
100000m or 1000000m?
Could this be a Bounding Co-ordinates issue?
------------------------------
John Ievers
CDR Group
Hope Valley, United Kingdom
Original Message:
Sent: 04-07-2020 09:28
From: David Wilson
Subject: There seems to be a distance limit to the CartesianOffsetXY function
Hi, We have a MapInfo table of region objects representing specific symbology (letters and arrows).
Previously in a MapX application we transformed the location of these objects using the basic transformation of coordinate formula for each node.
But in MapInfo 64bit (MBv17) I was trying to make use of the CartesianOffsetXY function. This works fine but seems to be limited to an offset of100000m. Is there any particular reason for this? I want to be able to relocate these objects anywhere within the UK.
If there is a limit as it looks then I'll have to revert to altering each node mathematically.
Thanks
David
------------------------------
David Wilson
Buchanan Computing
London, UK
------------------------------