# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# NearTransitStopMatrix.py
# Created on: 2017-05-16 14:32:16.00000
#   (generated by ArcGIS/ModelBuilder)
# Usage: NearTransitStopMatrix <Input_Point_FC> <Near_Point_FC> <Output_Table> 
# Description: 
# Generates a near table matrix that is used for Transit Stop Adjancency Analysis using point features containing transit stops
# within the nine-county bay area region.
# Data is generated using tabular output from the following R script:
# https://github.com/MetropolitanTransportationCommission/RegionalTransitDatabase/blob/c6875ea35b0baea2a8e5eecae143c8ffe3798b74/etl/RTD%20Data%20Processing.R#L284-L292
# Output can then be used in a sql table to generate a summary of shared or adjacent transit stops by operator, stop and route.
# See the following sql script which uses both the input and output used in this python script to generate the summary.
# ---------------------------------------------------------------------------

# Set the necessary product code
# import arcinfo


# Import arcpy module
import arcpy

# Script arguments
Input_Point_FC = arcpy.GetParameterAsText(0)
if Input_Point_FC == '#' or not Input_Point_FC:
    Input_Point_FC = "RTD_Operator_Adjacency_UTM" # provide a default value if unspecified

Near_Point_FC = arcpy.GetParameterAsText(1)
if Near_Point_FC == '#' or not Near_Point_FC:
    Near_Point_FC = "RTD_Operator_Adjacency_UTM" # provide a default value if unspecified

Output_Table = arcpy.GetParameterAsText(2)
if Output_Table == '#' or not Output_Table:
    Output_Table = "Database Connections\\Connection to GISPC.sde\\gis.DBO.Operator_Route_Adjacency" # provide a default value if unspecified

Create NearTransitStopMatrix.py