# PinDistance.qry # Pinmap selection script for geotagged image table # Selects photo pins within specified map distance of a reference point. numeric distance = 200; # specified distance in meters class POINT2D refpt, photo; # reference and photo points class SR_COORDREFSYS crs; # Set coordinate reference system crs.Assign("Geographic2D_WGS84_Deg"); # set longitude / latitude coordinates of reference point refpt.x = -96.6767763; refpt.y = 40.8087643; # get coordinates of current photo from table photo.x = `WPN Geotagged Images`.Longitude; photo.y = `WPN Geotagged Images`.Latitude; # call function that returns distance in meters between two points in # specified map projection and compare to target distance if (ProjDistanceToMeters(crs, photo.x, photo.y, refpt.x, refpt.y) <= distance ) return true; # selects records meeting criterion