I didn't go into detail on how to use Grid Index Features, so sorry for the confusion. The deal with using this tool is one needs to fill in several of the settings, some of which are not intuitive.
Input Features (optional): use your points layer
Number of Rows (optional): Number of the maximum count of points in the X dimension
Number of Columns (optional): Number of the maximum count of points in the Y dimension
Then run it. Note that the goal is to have one "box" (in the GridIndex) per point. Note that the resulting grid will have the points somewhat scattered around each box, i.e. the points won't be exactly in the same point in each box. But that's OK, we're using the grid (boxes) purely to derive the sort order, not as a final result.
In the resulting GridIndex, there will be a field called "PageNumber". That field represents the draw order for East-West, so that one is ready to go if you don't mind that it will create the extra diagonal lines as it creates the East-West linework (details on how to clean that up below).
The North-South order will need some processing of the existing attributes to derive it. Start by creating a new field (text) in the GridIndex like "SortNorthSouth" (Short Integer). Then use Field Calculator with the following VB statement (or use the Python equivalent):
Right( [PageName],1 )
Note that you may have to play with the value after the [PageName], depending upon how many digits your numbers have to correctly capture the value. For example, if the number values go up to 99, use ",2".
You will now have a grid that can be Spatial Joined to the points that will provide the proper order for lines to be drawn to the points.
Target: Your points
Join Features: the GridIndexFeatures
Match Option (optional): HAVE_THEIR_CENTER_IN
Next is the Feature to Line Geoproccesing Tool on your joined points, with one run for the NorthSouth lines and a second run to do the East-West lines:
- For each run use the Sort Field (optional) set to the field that provides the sorting.
The final result will look weird at first and need some final cleanup:
-The North-South lines will have some East-West segments.
-The East-West lines will have diagonal segments.
I'd start by getting rid of the diagonal lines in the East-West linework by starting an editing session and manually selecting and deleting them. There's probably a more elegant way to do this, but I'm blank at the moment on how to do it.
As for the unwanted East-West segments as part of the North-South linework, there are several options to eliminate them, but the easiest is probably to Union the North-South layer with the cleaned up (no diagonals) East-West linework, then taking the output and running a Dissolve on it.
Note that if at the end of all this you need their to be distinct lines between each point, there are several methods available to break up the lines at intersections and points.
Methods for splitting line features—Help | ArcGIS for Desktop
Anyways, give this a shot. There may have to be a few tweaks here or there to fine-tune it for your data, but it should work.
Chris Donohue, GISP