What is a Shomer Shabbos cemetery or plot and must one bury there?
Shomer Shabbos cemeteries or plots refer to a cemetery, or section of a cemetery, that is designated only for people who were Shabbos observant. While the earlier Poskim do not record such a concept of making a Shomer Shabbos cemetery or section, nevertheless it has become widespread in the last hundred years based on the above law that one may not bury a Rasha near a Tzaddik. Although defining who is a Rasha and who is a Tzaddik is not in the parameters of general people, nevertheless certain basic guidelines have become accepted, thus creating the Shomer Shabbos section in the cemetery. Accordingly, it is forbidden to bury one who is Shomer Shabbos in the non-Shomer Shabbos cemetery, if the surrounding graves are also not Shomer Shabbos. The same applies vice versa, that it is forbidden to bury one who was not Shomer Shabbos in the Shomer Shabbos section, or near one who was Shomer Shabbos. It is worthy however to note that some Poskim are completely lenient in this regard, and are not particular to bury a person near one who was Shomer Shabbos. In the event that the deceased requested to be buried near his family which were not Shomer Shabbos, one may do so.
Gentiles buried in Jewish cemeteries: Another issue to bear in mind is that unfortunately, some Jewish cemeteries are not particular to prevent people who are Halachicly defined as gentiles from being buried there. This is especially pertinent to reform and conservative cemeteries, who accept conservative and reform conversion. Thus, burying in a Shomer Shabbos section guarantees that one will not accidently be buried near a gentile.
Burying in a non-Shomer Shabbos plot: Despite the above, many cemeteries do not contain a Shomer Shabbos section. In such a case, one is to try to find a plot that is surrounded by graves of those who were Shomer Shabbos. If necessary, one may be buried in the cemetery even if he will be near non-Shomer Shabbos graves, although in such a case there should be a distance of eight Amos between his grave and the surrounding graves. Alternatively, if one cannot make such a distance, a Mechitza of Ten Tefachim [80 cm] that separates his grave from the other graves is to be set up. One can surround the grave with Hadassim that reach such a height, or place a bench or Ohel surrounding it. If one is unable to do the above, he should bury the deceased in a different cemetery, even if he is required to be buried in a different city. However, as stated above, some Poskim are completely lenient in this regard and in a case of doubt one is to ask his Rav.
 See Sefer Umikarev Beyemin 22 for a general overview of this subject; Igros Moshe Y.D. 2/152; 3/157; Teshuvos Vehanhagos 1/716; 2/598
 Michaber 362/5
 This is similar
 Igros Moshe 2/152 that if the person was well known to be Michalel Shabbos in public then it is forbidden for the Chevra Kaddisha to bury him near one who was Shomer Shabbos, or vice versa. If however it was not public knowledge that the person was Michalel Shabbos, even though it is known to certain individuals, then it is permitted to bury him near one who was Shomer Shabbos, unless the deceased who was Shomer Shabbos explicitly stated that he does not want to be buried near one who is rumored to have desecrated Shabbos, or transgressed another sin.
 Seridei Eish 2/98; Misgeres Hashulchan p. 179 that today we are no longer particular in this law; See Igros Moshe 3/157 that states one may bury a non Frum Jew near a Frum Jew as he still has Kedushas Yisrael and wants to be buried in a Jewish cemetery according to Jewish law, and only gentiles, or Jews that rebel against Torah and Mitzvos and do not have abortion in the world to come must be distanced from a Jewish cemetery; However see Igros Moshe 2/152 that clearly states it is forbidden to bury a Michalel Shabbos near one who was Shabbos observant. See Koveitz Techumin 17 for an article by Harav Bakshi Doron that today the Chevra Kadishas are no longer particular in this matter. Vetzaruch Iyun also from the fact that we do not find any special Shomer Shabbos plots in the old cemeteries in Europe and Russia, and thus how were thye careful to follow the above law!
 Igros Moshe 2/152
 Sefer Chassidim 707 to distance 8 Amos from a Menuda; Gilyon Mahrsha 362/5 regarding a Mumar; Milameid Lehoil 2/115; Igros Moshe 2/152; 3/157 that one is to make a fence of 10 Tefachim around the gentile and distance it 8 Amos; Teshuvos Vehanhagos 1/716 that by a Tinok Shenishba a four Ama distance suffices, however in 2/598 he requires an 8 Ama distance; See 362/3;
Other opinions: Some Poskim rule it suffices to distance him four Amos. [Imrei Yosher 2/3]
 Igros Moshe ibid; See Teshuvos Vehanhagos 1/716
 So I was told by Harav Y.S. Ginzberg that so is the custom in Russia.
 Teshuvos Vehanhagos 2/598