Advice sought!
As described in the Mapbasic on-line help, you can create a
run-time-defined region object using the statements:
Dim fltNodeX( ) as
float
Dim fltNodeY( ) as
float
Dim intNodes as
integer
Dim fltCentroidX as
float
Dim fltCentroidY as
float
Dim objRegion as object Create Region Into objRegion
0
for i=1 to
intNodes
Alter Object objRegion
Node Add ( fltNodeX(i), fltNodeX(i) )
next
This approach works fine, except that the
default centroid of the resultant object is always positioned at the first node
on the perimeter.
If you compute centroid coords and try to set
them explicitly using
Create Region Into objRegion 0
Center (fltCentroidX ,fltCentroidY
)
then the Center
clause appears to be ignored, because the centroid remains positioned at the
first node on the perimeter.
There does not seem to be a
variant of the Alter
Object statement to fix up the position of the centroid of a new
region object.
How do you set
the centroid of a region programatically?
David M
Haycraft
Phone/Fax: 61 + 2 + 6231 8104
Information Analysis Assocs P/L Mobile: 0412 001 134
ACN 085 516 105 Email: [EMAIL PROTECTED]
1 Cumming Place, Wanniassa Web: www.acslink.aone.net.au/actaa/iaa.htm
A.C.T. 2903, Australia A MapInfo Partner
Information Analysis Assocs P/L Mobile: 0412 001 134
ACN 085 516 105 Email: [EMAIL PROTECTED]
1 Cumming Place, Wanniassa Web: www.acslink.aone.net.au/actaa/iaa.htm
A.C.T. 2903, Australia A MapInfo Partner
