Hi Fiaz,
I've come up with the following. This could probably be done more accurately programmatically or using an alternative but see what you think.
- Rotate the polygon so that the polygon is on its side (with its straight edge running east-west). I did this by trial and error but you could calculate the angle beforehand. Use the Rotate Object that comes with the Map Cad tool.
WARNING: choose the anchor point carefully when rotating; you will use this same anchor point later when reversing the rotation.
- Use Grid Maker to create very small grid regions that cover your polygon – the smaller the more accurate.
- Delete grid regions that are outside your region.
- Perform a group by to find the min and max row value of each column:
Select Col_Name, Min(Row_Name) "MinRow", Max(Row_Name) "MaxRow" from Grid group by Col_Name into GridRowMinMax
- Perform a query that returns the middle row value:
Select Col_Name, MinRow, MaxRow, Int((MaxRow-MinRow)/2)+MinRow "MidRow" from GridRowMinMax into GridRowMinMaxMid
- Save this query and open as a new table
- Join this query to the Grid table:
Select * from Grid, GridRowMinMaxMid where Grid.Col_Name=GridRowMinMaxMid.Col_Name And Val(Grid.Row_Name)=GridRowMinMaxMid.MidRow into MiddleGrids
- Save the results and open as a new table
- You might then convert these to points perhaps (for greater accuracy)
Update MiddleGrids Set obj = CreatePoint(CentroidX(obj),CentroidY(obj))
- Then buffer the points to create your 5-foot-wide track:
- Erase Outside to straighten the end points if desired:
- Finally, return the object to the correct rotation (using the same anchor point as that used in step 1):
------------------------------
James Nolet
Dooley Mitchell & Morrison Pty Ltd
Mentone, VIC, Australia
------------------------------