Hi Dietrich If you have a point and want to find the nearst point i a table, try this SQL Dim MyPoint as Object MyPoint = Some Point Select * from MyPointTab Where Distance(centroidx(MyPoint), CentroidY(MyPoint), centroidx(Obj), CentroidY(Obj), "m") In (Select Min(Distance(centroidx(MyPoint), CentroidY(MyPoint), centroidx(Obj), CentroidY(Obj), "m")) from MyPointTab) Med venlig hilsen Peter Laulund ************************************************************* Kort & Matrikelstyrelsen · www.kms.dk National Survey and Cadastre - Denmark Rentemestervej 8 · DK 2400 København NV E-mail: [EMAIL PROTECTED] · Home: [EMAIL PROTECTED] Phone: +45 3587 5050 · Direct: +45 3587 5173 ************************************************************* "Dietrich Kastens" <[EMAIL PROTECTED]> - 06-01-2001 06:26:03 Besvar venligst til "Dietrich Kastens" <[EMAIL PROTECTED]> Til: [EMAIL PROTECTED] cc: "Dietrich Kastens" <[EMAIL PROTECTED]> (bcc: Peter Laulund/MI/KMS) Vedrørende: MI-L Need Code to find nearest Point
Hello all, Does anyone know of any code out there that would allow me to find a neareast nieghbor point to another point. In Mapbasic, the geographic search options are limited to mostly working with line and region features and thus don't help me. The SearchPoint function tries to match an exact Lat/Lon, which again doesn't help me. I am trying to find a simple piece of code that will allow me to select one point and then find the closest point to it. I have written code that did a similar task by incorporating a buffer around the point, but this won't work for me in this project because of the density of my point data (1 second interval GPS data). Any help would be greatly appreciated. Thanks, Dietrich Dietrich Kastens (785)843-7789 Home (785)626-4600 Mobile [EMAIL PROTECTED] www.kastensinc.com _______________________________________________________________________ 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.