Hi,
The trick here is to use the Nearest statement to draw lines between
the point objects and the closest point on the edge of the polygon.
For this to work the point objects and the polygon should be in
different tables and you need to create a new table to store the
results of the Nearest statement. You can not do this via Query > SQL
Select... You will need to use your MapBasic window here (and maybe
have a look in the MapBasic help or MapBasic Reference Guide for more
details on the Nearest statement)
Step 1: Create a new table (e.g. DistanceResults) with 3 columns: one
to hold the identifier of the Polygon, one to hold the identifier of
the Points and one for the Distance.
Step 2: The statement: Nearest All from table <PolygonTable> to
<PointsTable> into DistanceResults Data <Polygon ID>=<Polygon ID>,
<Point ID>=<Point ID>
(This statement will create 2-point polyline objects between the
points and the polygon - these line objects can be made visible by
adding the DistanceResults table to the Map Window)
Step 3: Update the Distance column in the DistanceResults table, using
either (depending on your projection/coordinate system) the function
ObjectLen or the the function CartesianObjectLen.
It might require some trial-and-error, but the moment you have got
this running you will be amazed :-)
HTH,
Egge-Jan