Dear List I would like to thank all 20 of the people who replied to my question from all around the world. The replies mainly consisted of two methodologies. I used the Mapbasic because it was unbelievably fast (I am however a pre-beginner in Mapbasic (!) so this was an excellent starting point). The fantastic thing was that it took all the attribute data with it - it is however very important to use a copy of the file as the polygons completely disappear. I have included the two main methods but at the end I have also included a slightly different idea from Laurence Seef and an xy.mbx routine suggested by Stephen Baig. A. save your polygon file under a new name (say new points) open newpoints as a mapper open the mapbasic window (options>>>open map basic window) type in the following> update newpoints set obj = createpoint(centroidx(obj),centroidy(obj)) hilite the text and press return this will only process on centroid per polygon if you have complex polygons (ie two polgons that act as one object), you will need to split them up first. B. make a copy of the table of your regions and add two columns to the attributes called XCOORD and YCOORD (type = integer). Now do a "Table > Update Column" and update the two columns with CentroidX(obj) and CentroidY(obj) Now do "Table > Maintenenace > Table Structure" and uncheck the box that says "Table is Mappable" this will remove all the map objects from the table. Now do "Table > Create Points" and select the copy of you regions table. Select XCOORD and YCOORD as the two columns to make the points from, hit the "projection" button and select british national grid and Hit OK and hey presto you have your points along with the relevant attributes. C. You must have a unique key field to do this (explained later). If you do not , then create a new filed and update it with "rowid" (leave off the "" when updating). 1. Save a copy of your table to a new name (lets say JPoints). 2. Open JPoints 3. Table -> maintenance->table structure-> Jpoints. Uncheck the "Table is mappable" checkbox. 4. Table -> maintenance->table structure-> OrgTable. Check index for key field. 5. Table->geocode. Select Jpoints and unique key field. In the "search table" box select OrgTable and Key field 6. OK. D. Make the region file editable and then use the tool add_xy.mbx. I believe I found this .MBX through the Mapinfo_L. If you aren't able to find it please let me know and I'll forward a copy to you. Remember, once the regions are reduced to the centroid points they may not be recovered. If you later will need the regions save a duplicate file!! Thank you all again Best wishes Jacqui Foskett -----Original Message----- From: MI Digest <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: 07 June 2001 10:38 Subject: MI Digest V1 #388 _______________________________________________________________________ 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.
Re: SUM MI-L region centroids to points
Chichester Harbour Conservancy Fri, 08 Jun 2001 01:21:09 -0700
