Hello Niklas, One of the "top tips" MapInfo sometimes gives at conferences is a method of averaging coordinate using a SQL query and the average function, avg(). For a table "MyTab" which contains points, you can determine the average by:
select avg(centroidx(obj)), avg(centroidy(obj)) from MyTab into AveragePos This will create a new table "AveragePos" with a single row in it containing coordinates. There are (at least) two warning points, neither of which seems to get mentioned. 1) Averaging the coordinate values only works accurately in straight grid/Cartesian space. Latitude/Longitude is not a simple grid. Therefore, it is not wise to use this method for points dispersed over a large area. 2) It's important to set the active coordination system in Pro as it defaults to lat/lon. If you points are in a different coordinate system, enter the following command in the MapBasic window. set coordsys table MyTab This will adopt the coordinate system from your point table, "MyTab". Given it's manual nature, this method is only useful for whole tables and query sub-sets. If you need to average many 50m square, you will probably need to write a MapBasic program to handle the iterations. Regards, Warren Vick Europa Technologies Ltd. http://www.europa-tech.com -----Original Message----- From: Karlsson Niklas [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 23, 2002 8:31 AM To: [EMAIL PROTECTED] Subject: MI-L spatial averaging Hi, I've got a problem where I should average measurements (a simple value together with x and y coords) in a grid. For instance, I insert all of my measurements in a 50x50m grid and average all values within each "square". Is there a good way of doing this in MapInfo (v6) ? BR // Niklas --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
