Jess

Looks like you've been had by one of the "gotchas" in MapInfo Pro's
repertoire of  idiosyncrasies.  Don't feel bad, because many other users of
the product have been confused too, at one time or another.

The problem is that the functions CentroidX(Obj) and CentroidY(Obj) break
with programming convention (*) and involve a second implicit parameter in
addition to the explicit Obj parameter .

This second parameter was traditionally called the "MapBasic Coordsys" and
now, in MapInfo Pro 7, is referred to as the "Session Projection".
CentroidX() and CentroidY(), return coordinate values, not in the projection
of the table containing the Objs, but in the Session projection, which is
set to "Long-Lat" whenever you launch MapInfo Pro.

Suppose that the point table that you create with File>Save Copy As...  and
a local projection is called PointsLocal.

If you're using an old version of MapInfo,  then, before using CentroidX()
and CentroidY() do this:
1.  select Options>Show Mapbasic Window
2.  in the Mapbasic window type "set coordsys table PointsLocal"

If you're using MapInfo 7, then choose Options>Preferences>Map Window ,
click the Session projection button and select the Projection in which you
want your coordinates to be returned by CentroidX() and CentroidY().  This
would be the same Projection that you selected during File>Save Copy As...

------------------------
(*) This behaviour is documented, although not in a medium accessible to the
regular MapInfo Pro punter.  For example the MapBasic 7 on-line Help says
about CentroidX()

<QUOTE>
The CentroidX( ) function returns the X coordinate (e.g. Longitude)
component of the centroid of the specified object. See the Centroid( )
function for a discussion of what the concept of a centroid position means
with respect to different types of graphical objects (lines vs. regions,
etc.).

The coordinate information is returned in MapBasic's current coordinate
system; by default, MapBasic uses a longitude, latitude coordinate system.
The Set CoordSys statement allows you to change the coordinate system used.
</QUOTE>

Regards

David M Haycraft
Information Analysis Associates  Pty Ltd
1 Cumming Place, Wanniassa, 2903
Aust Capital Territory,  Australia
Email:  [EMAIL PROTECTED]
Web :  www.acslink.aone.net.au/actaa/iaa.htm



----- Original Message -----
From: "Jessie O. Floren" <[EMAIL PROTECTED]>
To: "'MI-List'" <[EMAIL PROTECTED]>
Sent: Tuesday, 10 September 2002 19:03
Subject: MI-L WGS84 to Local Projection


> Hi List!
>
> I have a point data obtained from a GPS using WGS84 and plotted it using
> MapInfo.  I tried to save it using SAVE>COPY AS in a different projection
> (local).  I opened the reprojected file and noticed the changes of the
> coordinates in any point by double clicking it but when I tried to extract
> the coordinates using CentroidX(obj)/CentroidY(obj) functions the value
> obtained was the original coordinates which is in WGS84.  I expected that
> the result would yield the coordinates in the new projection.  Anybody who
> can enlighten me, please? What did I miss?
>
> Jess
>
>
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> Message number: 2926
>





---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 2932

Reply via email to