Thanks. The layers use the exact same coordinate system. Great, this allows us to not write the code that would convert between different coordinate systems, making queries shorter. Here's what you can try: --SQL9 VALUE @allpoints GEOM = (SELECT GeomMergePoints([geom (i)]) FROM [Postes]); SELECT mfd_id, GeomDistance([geom (i)], @allpoints, 0) FROM [Zones]; -- SELECT Min(GeomDistance([geom (i)], @allpoints, 0)) FROM [Zones]; -- returns: 0 The first statement (VALUE) merges all points together into a value named @allpoints. The second statement (SELECT) shows the distance from each area to that geom (so, the minimum distance from each area in 'Zones' to the points in 'Postes'). The third statement (SELECT with Min) shows the minimum of the distances shown by the second query, but it currently returns 0 because some points landed in some areas, this is why I am leaving uncommented the second query - its results are more interesting.
|