From: Chris Skelly@MOH on 08/06/99 22:21
To: [EMAIL PROTECTED]
cc:
Subject: My centroids problem solved!
Thanks to all for their suggestions regarding a problem in MapInfo which makes
it difficult to extract the centroids of polygons in anything but Lat-Long, even
when you are using a cartesian coordinate system. Chris Perry and Jacques Paris
provided a solution that works, which I'll relay here for anyone who is
interested.
If you run an SQL query using the functions CentroidX(obj) and CentroidY(obj) to
create coordinates from which to create a new points data set, you may find (as
I did) that MapInfo will refuse to give you anything other than Lat-Long
coordinates. However, if you issue the command "Set coordsys table
<yourtablename>" in the MapBasic window before the SQL query, MapInfo will
return the coordinates in the appropriate coordinate system.
A couple of other respondents replied that I could use the Lat-Long coordinates,
save them to a file with a new projection. This works, except for those of us in
New Zealand who still have to deal with the continuing problem that we cannot
save to a NZ Map Grid Coordinate System! It is necessary to paste the
appropriate coordinate system code into the file (which needs to be converted
into a MIF file first - what a pain!). The line of code is
CoordSys Earth Projection 18, 31, "m", 173, -41, 2510000, 6023150 Bounds
(1000000, 3000000) (3000000, 8000000)
So thanks guys - my time to a solution from sending in the email - 22 minutes!
Cheers,
Chris
Chris Skelly, PhD, Senior Advisor (Environmental Health),
Public Health Group, Safety and Regulation Branch, Ministry of Health
133 Molesworth Street, PO Box 5013, Wellington, New Zealand
Ph: +64 4 496-2215, Fx: +64 4 496-2340, Email: [EMAIL PROTECTED], WWW:
http://www.moh.govt.nz
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]