Hello Francois,
 
   This is an extract from the Mapbasic Help :
 
>Setting a Centroid
>The Centroid of a Region and Polyline can now be set by using the Alter Object command with the syntax noted below:
>Alter Object Obj Geography OBJ_GEO_CENTROID, PointObj
>Note that PointObj is a point object.  This differs from other values input by Alter Object Geography, which are all >scalars.  A point is needed in this instance because we need two values which define a point.  The Point that is >input is checked to make sure it is a valid Centroid (i.e., it is inside the region).  If the Obj is not a region or >polyline, or if PointObj is not a point object, or if the point is not a valid centroid, then an error is returned.
>An easy way to center an X and Y value for a centroid is as follows:
 
>Alter Object Obj Geography OBJ_GEO_CENTROID, CreatePoint(X, Y)
 
>The user can also query the centroid by using the ObjectGeography function as follows:
 
>PointObj = ObjectGeography(Obj, OBJ_GEO_CENTROID)
 
>Note that there are other ways to get the Centroid, including the Centroid(), CentroidX(), and CentroidY() >functions.  These functions remain unchanged.
>OBJ_GEO_CENTROID is defined in mapbasic.def.
 
   And this is an extract from the MapInfo Help :
 
>Changing A Region's Centroid
>Autolabels, thematic bar and pie charts, and point objects created by geocoding are drawn at the object's centroid. >You can move a region's centroid which will in turn affect the location of all future objects drawn in this region. >However, autolabels, and geocoded point objects drawn prior to changing an object's centroid remain unchanged.
>To move a region's centroids:
>1. Choose Map > Layer Control > Display > Show Centroids, the centroids are displayed.
>2. Click the Select button in the Main Toolbar to access the Select tool.
>3. Select the object whose centroid you want to move.
>4. Click on the Reshape button in the Drawing Toolbar.
>5. Click on the centroid and drag it to another location within the object.
 
   Hope this help,
 
   Carlos Montalvillo G�mez
   SGSMap - Ingenieros Consultores
   Camino de Portuetxe, 83
   20018 - San Sebastian - Espa�a
   Tel (+34) 943 31 74 90
   http://www.sgsmap.com/
   mailto:[EMAIL PROTECTED]
 
----- Original Message -----
Sent: Friday, October 20, 2000 12:46 PM
Subject: MI-L MapBasic Centroid question

Hello,

I have a problem with MapBasic 5.0 :
Is there an easy way to modify the object centroid of a polygon?
(the only way i see actually is to create a new object with the
clause Center (newCenterX,newCenterY);
may be its possible to use Alter Object, but how?)

TIA

-------------------------------------------------
Fran�ois CABRIEL
Service Analyse Spatiale
Conseil R�gional Provence-Alpes-C�te d'Azur
T�l�phone   = 04.91.57.50.57 poste 5848
Internet = [EMAIL PROTECTED]
==========================
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to