Hi Duncan,
I came up with the following but it will only give the MBC of the MBR of the polygon:
First, issue the following in the MapBasic Window:
Set Distance Units "m"
(ensure the units string matches that used by your table's coordinate system)
Then execute the following Select statement (in one of the later versions of MapInfo), to create a circle bounding each region object within table "PolyTable"
Select t.*, CreateCircle(CentroidX(t.obj), CentroidY(t.obj), sqr((ObjectGeography(t.obj, 3)-CentroidX(t.obj))^2 + (ObjectGeography(t.obj, 4)-CentroidY(t.obj))^2)) Object
From PolyTable As "t"
Where str$(obj) = "region"
Into tab_MBC_of_MBR
This Select statement uses the ObjectGeography function twice - the first time to retrieve the max X coordinate of the MBR and the second to retrieve the max Y coordinate of the MBR. These values, plus the Centre coordinates of the MBR and pythagoras' theorem, are used to find the radius of the circle.
Example:
Unfortunately, this will create a larger circle than the MBC. To find the correct MBC is more difficult. It looks like there are a couple of algorithms to choose from to generate the MBC, but it would require some programming.
------------------------------
James Nolet
GIS Manager
Caf Consulting
Mentone office, VIC, Australia
------------------------------
Original Message:
Sent: 10-31-2023 17:44
From: Duncan Stokes
Subject: Minimum bounding circle
So, I was asked a question recently and without going away and writing something in MapBasic etc I couldn't answer it.
Is there a simple method in MapInfo to find the minimum bounding circle of a region object?
------------------------------
Duncan Stokes
Corporate Systems Data Manager
Unison Greater Manchester Police Branch
MANCHESTER
------------------------------