some amendments to spatial query functions and beginnings of add new layer from selection