(a) No person, knowingly or intentionally, may sell or offer to sell any alcoholic beverage in or within 100 yards of a church or within 200 yards of any school building. (b) The school building referred to in this section shall apply only to state, county, city or church school buildings and to such buildings at such other schools in which are taught subjects commonly taught in the common schools and colleges of this state. The term "school building" includes only those structures in which instruction is offered. (c) The term "church building" as used in this section shall mean the main structure used by any religious organization for purposes of worship. (d) For the purposes of this section, distance shall be measured in a straight line from the main entrance of the school or church building in question to the main entrance of the establishment for the sale of alcoholic beverages in question. (e) No location which is licensed to sell alcoholic beverages on the effective date of the ordinance from which this chapter is derived shall be denied continued operation under an existing license, or denied any renewal of such license, nor shall any new owner of such location be denied a new license based upon the measurements set forth in this section. (f) As to any location licensed in the future, if the distance requirements in this section are met at the time of issuance of any license, the subsequent opening and operation of a church or school within the distance prohibited in this section shall not prevent the continuance of an existing license or the renewal thereof or the issuance of a new license to any subsequent owner of such property.