----- Original Message -----
From: <[EMAIL PROTECTED]>
> I've checked my code, I can't see anything wrong. Is this a problem in
> mapbasic?
>
> Using ObjectGeography(linebegx etc, though minx gives the same result)
>
> X1 = 2717952.07
> Y1 = 5988296.66
>
> X2 = 2717954.8
> Y2 = 5988366.06
>
> Using ObjectNodeX/ObjectNodeY on the same line:
>
> X1 = 2717954.8
> Y1 =5988366.06
>
> X2 = 2717952.07
> Y2 = 5988296.66
If you look in MAPBASIC.DEF, you will see:
define OBJ_GEO_MINX 1
define OBJ_GEO_LINEBEGX 1
You have been bitten by the fact that ObjectGeography() uses the same value
to
mean different things for different types of objects. For a given object
o,
ObjectGeography (o, 1) means "beginning of the line" ONLY if o is a LINE.
For all other types of object, including polylines, ObjectGeography (o, 1)
is the "Minimum X of the object's minimum bounding rectangle."
The only way to get node coordinates for a polyline or region is to use
ObjectNodeX() and ObjectNodeY().
You must ALWAYS check an object's type before attempting to process it.
HTH
Spencer
_______________________________________________________________________
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.