|
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. 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]
|
- MI-L MapBasic Centroid question CABRIEL Francois
- Carlos Montalvillo
